Coordinates from a KML file not displayed properly in Google Maps - google-maps

I have a KML file and I extract the last coordinates and try to set them as a center of a Google Map but the marker is in a completely different place .
Do I have to "convert" KML coordinates into google maps coordinates ?
Thanks a lot

KML coordinates are x,y (longitude, latitude), whereas Maps uses LatLng (or y,x / latitude, longitude).
Just switch the x and y order and you should be all set.

Related

Google Maps draw area / shape / region and export as latitude longitude

I need a Google Map with marked up areas with different colors.
GADM data
The first article I came across was this one:
https://ourcodeworld.com/articles/read/830/how-to-highlight-an-area-city-state-or-country-in-google-maps-with-javascript
It links to this service for getting coordinates:
https://gadm.org/download_country_v3.html
The problem is that there are too many points so it would end up with 3MB for an embedded map.
Google Maps draw
Then I tried Google Maps service to draw a shape. While it works, I could not find any export function to get the longitude and latitude.
https://www.google.com/maps/d/u/0/viewer?mid=1IlydZDXB-tkN8K8pAR57BRFqBOTv3c8z&ll=59.681023024095936%2C18.40997752499993&z=9
Question
How can I draw an area on a map and then get longitude and latitude for the points? On Google Maps, a tool or something else does not matter.
I solved my problem very differently. I simply used an svg file of just the country and highlighted areas there.
I used this site:
https://simplemaps.com/custom/country

Google MAP URL Parameters to draw polyline

Is there any way to draw a polyline on google map using its URL parameters?
I know we can draw points on map but what about lines?
for example this URL zooms into a location
http://maps.google.com/maps?q=51.8757057,0.5278316&z=18&t=k
I want something that I can add to Google maps URL and draw a line on map.Is it even possible?
Could be you can use staticmap where size is for the dimension and path is a collection of coord separated by | char
http://maps.googleapis.com/maps/api/staticmap?size=400x400&path=40.737102,-73.990318|40.749825,-73.987963|40.752946,-73.987384|40.755823,-73.986397&sensor=false

Matching coordinates on Google Maps to planetary.js

I am looking to migrate from Google Maps to planetary.js and I need to move a bunch of markers. Does anyone know how Google Maps coordinates match to coordinates in planetary.js?
If I have a Google Maps location such as "-33.654437, 151.188164" - what does this map to in planetary.js?
Those should be latitude/longitude coordinates, and you can be converted into x/y coordinates on the planet's projection via D3's projection. The projection is exposed in Planetary.js as planet.projection.
As it seems they are the same, switching the x and y coordinate works for me.
Google / Openstreetmap: "-33.654437, 151.188164"
Planetary.js: (151.188164, -33.654437)

How to adjust the difference between the coordinate from openstreetMap and google map

I have downloaded the OSM from OpenstreeMap that came with all nodes from the map and their respective coordinates. Now I have to plot a node (latitude and longitude) on Google Map, but all coordinates goes in different places than it should be.
To illustrate I got the node -12.92122,-38.34991 (lat,long) on google maps and openStreetMap as you can see on screenshots.
My question is how can I adjust these values.. so I can plot the node on google maps at the same place of openStreetMap.

Google Map Over Lays using KML file

I have a KML file with hundreds of lat/long points used to draw overlays on Google Maps.
Example KML file. http://www.no5w.com/OverlayON_Rev2.kml
Example displayed on a map:
http://www.no5w.com/CQxONOverlay.html
My problem is placing markers on the map. I only want to display markers on the map if they are within the overlay.
Is there any way to do this?
Thanks in advance.