JavaScript Google Maps incorrect GeoJSON rendering google maps incorrect location,google maps incorrect address,google maps

I am trying to plot a GeoJSON LineString on Google Maps using Google Maps API.

I am getting the GeoJSON object as an AJAX response and am using "map.data.addGeoJson(data)" function to load the GeoJSON response on the map.

The GPS latitude and long points have all been ripped from .gpx files from Open Street Maps website and then put in the database. They are then compiled into GeoJSON format and then sent to the website.

The individual points are all in Germany, but the trajectory is rendered near Somalia.

Can anyone help me please?

The initMap function containing the AJAX request is as follows:

       function initMap() {

    var map = new google.maps.Map(document.getElementById('map'), {
      zoom: 12,
      center: {lat: 53.44620230866472, lng: 9.666813185187198},
      mapTypeId: google.maps.MapTypeId.TERRAIN,
    });


    $.ajax({
    url: 'http://ADDRESS TO SERVER/api/geodata/getLineString',
    data: {"usrid":3,"startd":"2016-04-17","endd":"2016-04-18"},
    type: 'POST',
    success: function (response) {
    map.data.addGeoJson(response);
        },
    error: function () {
        alert("error");
    },
});
  }

The entire GeoJSON response is as below:

      {
  "type": "Feature",
  "geometry": {
    "type": "LineString",
    "coordinates": [
      [
        51.731921404763426,
        14.342405595236764
      ],
      [
        51.731914999999994,
        14.342412
      ],
      [
        51.73192399392278,
        14.342408729482642
      ],
      [
        51.73193,
        14.342416000000004
      ],
      [
        51.731934,
        14.342417000000001
      ],
      [
        51.73193,
        14.342411999999998
      ],
      [
        51.731926,
        14.342408
      ],
      [
        51.73192399392278,
        14.342408729482642
      ],
      [
        51.731921404763426,
        14.342405595236764
      ],
      [
        51.73199100000001,
        14.34214
      ],
      [
        51.73198299999999,
        14.342144
      ],
      [
        51.731987,
        14.342298000000001
      ],
      [
        51.731983,
        14.342302000000002
      ],
      [
        51.731983,
        14.342303999999999
      ],
      [
        51.73199100000001,
        14.342310000000001
      ],
      [
        51.731995000000005,
        14.342308
      ],
      [
        51.731998,
        14.342317
      ],
      [
        51.731999943503226,
        14.34232428813586
      ],
      [
        51.732002,
        14.342319000000002
      ],
      [
        51.732006000000005,
        14.342308000000003
      ],
      [
        51.732009999999995,
        14.342290999999996
      ],
      [
        51.73201799999999,
        14.342276
      ],
      [
        51.732025,
        14.342262999999999
      ],
      [
        51.732025,
        14.342252999999998
      ],
      [
        51.732032999999994,
        14.342243
      ],
      [
        51.732032999999994,
        14.342237000000003
      ],
      [
        51.73202500000001,
        14.342224000000002
      ],
      [
        51.73201799999999,
        14.342204999999996
      ],
      [
        51.73201,
        14.342184999999999
      ],
      [
        51.732002,
        14.342166
      ],
      [
        51.731995000000005,
        14.342153
      ],
      [
        51.731995000000005,
        14.342149000000001
      ],
      [
        51.73199100000001,
        14.34214
      ],
      [
        51.731976333334124,
        14.340528000002589
      ],
      [
        51.73196,
        14.340535
      ],
      [
        51.731934,
        14.340549
      ],
      [
        51.73190300000001,
        14.340559
      ],
      [
        51.731873,
        14.340569
      ],
      [
        51.731846000000004,
        14.340582
      ],
      [
        51.731815,
        14.340595
      ],
      [
        51.731789,
        14.340612000000002
      ],
      [
        51.731762,
        14.340625999999999
      ],
      [
        51.73173100000001,
        14.340643
      ],
      [
        51.731705,
        14.340658
      ],
      [
        51.731674,
        14.340673
      ],
      [
        51.731651,
        14.340681999999997
      ],
      [
        51.731621,
        14.340693
      ],
      [
        51.73160200000001,
        14.340705999999997
      ],
      [
        51.731586,
        14.340723
      ],
      [
        51.731567,
        14.340734000000003
      ],
      [
        51.731548,
        14.340740000000002
      ],
      [
        51.73153299999999,
        14.340748999999999
      ],
      [
        51.731514,
        14.340759
      ],
      [
        51.731495,
        14.340764000000002
      ],
      [
        51.731476,
        14.340768
      ],
      [
        51.731472,
        14.340768
      ],
      [
        51.731472,
        14.340765999999997
      ],
      [
        51.731468,
        14.340762
      ],
      [
        51.73146799999999,
        14.340772999999999
      ],
      [
        51.731468,
        14.340788
      ],
      [
        51.731472,
        14.340809
      ]
      ]
      },
  "properties": {
    "trajectoryid": "05BC2B9E-7350-4D55-B4BB-026EC0B2E65B",
    "color": "blue"
  }
  }
Answer:1

I recently asked this question Since then I have discovered that what I wanted to do wont work. This is because the table is generated by a for loop, with their id incrementing each time. As such, ...

I recently asked this question Since then I have discovered that what I wanted to do wont work. This is because the table is generated by a for loop, with their id incrementing each time. As such, ...

Here is my Angular app var filterData = angular.module('myApp',[]).controller('CallWebApi', function($scope, $http) { // Local version of the data $http.get('./events.js'). success(...

Here is my Angular app var filterData = angular.module('myApp',[]).controller('CallWebApi', function($scope, $http) { // Local version of the data $http.get('./events.js'). success(...

  1. convert this date into roman numerals
  2. convert date
  3. convert date sql
  4. convert date to string
  5. convert date to timestamp
  6. convert date to string sql
  7. convert date sql server
  8. convert date format in sql
  9. convert date to text excel
  10. convert date to roman numerals
  11. convert date to string javascript
  12. convert date to string java
  13. convert date to localdate
  14. convert date to milliseconds
  15. convert date to month in excel
  16. convert date to string python
  17. convert date sql server dd/mm/yyyy
  18. convert date format in excel
  19. convert date to timestamp javascript
  20. convert date to string php

Just wondering, is it possible to use only Javascript to hide/show elements without using "style" method? So I won't have to use any inline CSS in my HTML element. Or even, how does jQuery perform the ...

Just wondering, is it possible to use only Javascript to hide/show elements without using "style" method? So I won't have to use any inline CSS in my HTML element. Or even, how does jQuery perform the ...

  1. hide show elements javascript
  2. hide/show elements when checkbox is selected
  3. hide show elements jquery
  4. hide show elements css
  5. hide show elements html
  6. show/hide elements depending on screen size
  7. show/hide elements based on selected option
  8. show & hide elements on click
  9. show hide elements react
  10. show hide elements
  11. show hide elements react native
  12. show hide elements in react js
  13. show hide elements revit
  14. show hide elements angular
  15. show hide elements bootstrap
  16. show hide elements angular 4
  17. show hide elements dreamweaver
  18. show hide elements wordpress
  19. show hide elements responsive design
  20. show hide element angularjs

I have a well working fullcalendar script that adds css-classes to events according to data attributes via eventRender. I now need to filter these specific attributes with checkboxes, but I have no ...

I have a well working fullcalendar script that adds css-classes to events according to data attributes via eventRender. I now need to filter these specific attributes with checkboxes, but I have no ...

  1. filter fullcalendar events
  2. fullcalendar filter events example
  3. fullcalendar filter events
  4. fullcalendar events filtering