4 ms·
I expect a visit or two to Null Island every time I do a Google Map that has some layer of sophistication to it. I used Google Maps embed last week and a 'elem
by Theodores 11y ago
I expect a visit or two to Null Island every time I do a Google Map that has some layer of sophistication to it.
I used Google Maps embed last week and a 'elementary error' in my code meant that I was getting 'null island' quite consistently. I had a string with the latitude and longitude in, I just needed a bit of code to write out the map marker and center location for the frontend javascript. I was taking a string with 'lat, lon' and parsing it into an array, but doing it wrongly, i.e. with my own special syntax, so, instead of sending the latitude as '53.1234' I was sending the latitude of '5' and the longitude of '3' (having not made the string into an array).
I also had to battle with loading the map under a CSS in-page 'tab' (rather than browser tab) and you have to remember how to get it to load centered and not as a grey rectangle. Therefore getting to Null Island rather than a grey rectangle or a js error is pretty good. I then know I just have some problem like described earlier of mixing the lat/lon somehow.
Consequently for me, 'Null Island' rather than '-999,+999' is a good thing, I can at least load a map.
- ovis 11y agoBut you load a map with incorrect data. Wouldn't a good JS error be much more explicit? I do a lot of geospatial data crunching, and the thought of having wrong but valid data injected into my pipelines makes me uneasy.