JavaScript Leaflet swap the coordinates when use geoJson leaflet swap coordinates

I have little leaflet application where the app get geoJson objects from server, and display it, specially LineString. The json parser that i use on server side works properly. And the client side script was ok too.

But some reasons i would like to draw arrow on the routes, and i can't figure out how to do it when using L.geoJson().

Code with L.geoJson():

   getJsonFrom(routeQueryURL, params, function(data) {
     var a = L.geoJson(data, {
       onEachFeature: bindRouteDirection,
     }).addTo(map);
   });

Because i don't want to change anything on server side, i tried this:

getJsonFrom(routeQueryURL, param, function(data) {
    $.each(data, function(index, feature) {
      var polyline = new L.Polyline(feature.geometry.coordinates, {
        color: feature.properties.color,
        opacity: 0.8
      }).addTo(routeMapLayer);

      var decorator = L.polylineDecorator(polyline, {
        patterns: [{
          offset: 25,
          repeat: 50,
          symbol: L.Symbol.arrowHead({
            pixelSize: 15,
            pathOptions: {
              stroke: true,
              color: feature.properties.color,
              fillOpacity: 0.8,
              polygon: false,
              weight: 3
            }
          })
        }]
      }).addTo(routeMapLayer);

      map.addLayer(routeMapLayer);
    });
  });

So i access the array of coordinates from the geoJson object, and some other data, and draw the polyline directly on to map.The problem is that it's put my route into the middle of middle east instead of Hungary, so it's actually swap the coordinates. Why does L.Polyline handle the different form L.geoJson() ?

Answer:1

This is my code,i don't know why case 0, and case 1 are not working? are there any responses for these levels? This is the output request received processing request request finished and response is ...

This is my code,i don't know why case 0, and case 1 are not working? are there any responses for these levels? This is the output request received processing request request finished and response is ...

How can i draw only two images with reversing I don't know how to reverse. Pls help. var canvas = document.createElement('canvas'); canvas.width = 16 * scale; canvas.height = 32 * scale; ...

How can i draw only two images with reversing I don't know how to reverse. Pls help. var canvas = document.createElement('canvas'); canvas.width = 16 * scale; canvas.height = 32 * scale; ...

  1. horizontally flip image iphone
  2. horizontally flip image css
  3. horizontally flip image python
  4. horizontally flip image online
  5. vertical flip image
  6. vertical flip image python
  7. vertical flip image iphone
  8. vertical flip image online
  9. vertical flip image css
  10. vertical flip image matlab
  11. flip image horizontally photoshop
  12. flip image horizontally android
  13. flip image horizontally after effects
  14. flip image horizontally matlab
  15. flip image horizontally premiere
  16. flip image horizontally illustrator
  17. flip image horizontally html
  18. flip image horizontally powerpoint
  19. flip image horizontally java
  20. flip image horizontally opencv

I know that it's not the best approach to overwrite native JS API and I do it more for experiment. I would like to overwrite Promise resolve method handler to do some extra logic on each resolve. Is ...

I know that it's not the best approach to overwrite native JS API and I do it more for experiment. I would like to overwrite Promise resolve method handler to do some extra logic on each resolve. Is ...

I am attempting to dynamically create an object with name-value pairs using html input fields. This is what i have so far: var taskComplete = { newTask: function(arg) { var fieldObj = {}, ...

I am attempting to dynamically create an object with name-value pairs using html input fields. This is what i have so far: var taskComplete = { newTask: function(arg) { var fieldObj = {}, ...

  1. access dynamically created element jquery
  2. access dynamically created controls c#
  3. access dynamically-created-elements javascript
  4. access dynamically created text field with jquery
  5. c# access dynamically created textbox
  6. asp.net access dynamically created controls
  7. vb.net access dynamically created control