Coder Social home page Coder Social logo

Comments (8)

diegosanz avatar diegosanz commented on June 8, 2024 1

My mistake! Now I have my application working, many many thanks!

from leaflet-ugeojson.

BenjaminVadant avatar BenjaminVadant commented on June 8, 2024

You should use the "parameters" option: https://github.com/BenjaminVadant/leaflet-ugeojson#how-to-use-the-parameters-option

from leaflet-ugeojson.

diegosanz avatar diegosanz commented on June 8, 2024

I need those parameters dynamically, but by now I'm hardcoding them like this:

L.uGeoJSONLayer({
        endpoint: 'https://server/GetCoordinatesForPolygon',
        parameters: function () { return { "x": "42", "y": "-2" } } 
      })

but in my browser, on request payload I'm getting this:

------WebKitFormBoundaryvF0jiA9IydbAwY8N
Content-Disposition: form-data; name="south"

41.47154438707647
------WebKitFormBoundaryvF0jiA9IydbAwY8N
Content-Disposition: form-data; name="north"

41.881831370505594
------WebKitFormBoundaryvF0jiA9IydbAwY8N
Content-Disposition: form-data; name="east"

0.435333251953125
------WebKitFormBoundaryvF0jiA9IydbAwY8N
Content-Disposition: form-data; name="west"

-0.08514404296875001
------WebKitFormBoundaryvF0jiA9IydbAwY8N
Content-Disposition: form-data; name="zoom"

10
------WebKitFormBoundaryvF0jiA9IydbAwY8N--

Thank you for the fast response.

from leaflet-ugeojson.

BenjaminVadant avatar BenjaminVadant commented on June 8, 2024

You catch a mistake in the code!
It should now be fixed.

Thanks!

from leaflet-ugeojson.

diegosanz avatar diegosanz commented on June 8, 2024

Thanks! Now it's working!
But I think that I catch another mistake or I'm doing something wrong: my server requires an 'application/json' enctype. I put enctype: 'json' on uGeoJSONLayer config, but the request still being Content-Type: text/plain;charset=UTF-8.
I made a hotfix writting: request.setRequestHeader('Content-Type', 'application/json'); on line 119, just before i send it.
Is there any other way to do it?
because i've hard coded your code to achieve this.
Thanks

from leaflet-ugeojson.

BenjaminVadant avatar BenjaminVadant commented on June 8, 2024

Content type is set in headers so ... use the headers option! https://github.com/BenjaminVadant/leaflet-ugeojson#how-to-use-the-headers-option

from leaflet-ugeojson.

BenjaminVadant avatar BenjaminVadant commented on June 8, 2024

When you are done, can you send me a link to your application?

from leaflet-ugeojson.

diegosanz avatar diegosanz commented on June 8, 2024

Sorry, my application it's for a top scret's FBI project.
Ha, ha, it's a joke, but it's for a private company than they want to visualize their properties and it's not a public app.
Anyway, I'm going to make a pull request to add one new feature soon ;)

from leaflet-ugeojson.

Related Issues (6)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.