Easy way to find out where you are on the map

The place to get information and ask questions about everything to do with properly and successfully editing the Waze Map.

Use this forum for all general editing questions, and the sub-forums for specific types of Waze Map Editor features.

Moderators: Unholy, bextein

Easy way to find out where you are on the map

Postby trojaneel » Fri Nov 20, 2009 1:40 pm

I'm editing in a region that has few roads already defined, so sometimes it's a bit of a puzzle to navigate and find out what the street name of a road is. If I'm completely lost, it often helps to open a site like Google Maps and enter the coordinates.

To make that easier, I created the following bookmarklet. If you make a bookmark of this, opening that bookmark will open Google Maps with the map centered on the same position as your Cartouche map (you need it open it while you have Cartouche in the browser window). It will also set the zoom level to approximate Cartouche's zoom.

As it is a JavaScript url, I cannot create a link to it here in the forum. However, it will work if you copy this link and paste it as the URL of a new bookmark. You can also place that bookmark on your browser toolbar.

Google Maps:
Code: Select all
javascript:(function(){var%20center_lonlat%20=%20new%20OpenLayers.LonLat(g_cartouche.map.center.lon,g_cartouche.map.center.lat);center_lonlat.transform(new%20OpenLayers.Projection("EPSG:900913"),%20new%20OpenLayers.Projection("EPSG:4326"));window.open('http://maps.google.com/maps?q='+center_lonlat.lat+','+center_lonlat.lon+'&z='+%20(g_cartouche.map.zoom+12));})();


Update 20/11: Fixed bug that caused Cartouche window to disappear after opening map (thanks, robin1979!)
Update 20/11: Also created bookmarklets for OSM and Bing:
Update 10/03: Replaced scripts after API change, and added 1 new. Thanks to an unknown contributor (Google Maps, posted here by gerben), naesstrom (Bing), MisterAsterix (Mapquest) and me (OpenStreetMap)

OpenStreetMap:
Code: Select all
javascript:(function(){var%20center_lonlat%20=%20new%20OpenLayers.LonLat(g_cartouche.map.center.lon,g_cartouche.map.center.lat);center_lonlat.transform(new%20OpenLayers.Projection("EPSG:900913"),%20new%20OpenLayers.Projection("EPSG:4326"));window.open('http://www.openstreetmap.org/?mlat='+center_lonlat.lat+'&mlon='+center_lonlat.lon+'&zoom='+%20(g_cartouche.map.zoom+12));})();


Bing:
Code: Select all
javascript:(function(){var%20center_lonlat%20=%20new%20OpenLayers.LonLat(g_cartouche.map.center.lon,g_cartouche.map.center.lat);center_lonlat.transform(new%20OpenLayers.Projection("EPSG:900913"),%20new%20OpenLayers.Projection("EPSG:4326"));window.open('http://www.bing.com/maps/?cp='+center_lonlat.lat+'~'+center_lonlat.lon+'&where1='%20+center_lonlat.lat+','+center_lonlat.lon+'&lvl='+%20(g_cartouche.map.zoom+12));})();


Mapquest:
Code: Select all
javascript:(function(){var%20center_lonlat%20=%20new%20OpenLayers.LonLat(g_cartouche.map.center.lon,g_cartouche.map.center.lat);center_lonlat.transform(new%20OpenLayers.Projection("EPSG:900913"),%20new%20OpenLayers.Projection("EPSG:4326"));window.open('http://atlas.mapquest.com/maps/map.adp?searchtype=address&formtype=address&latlongtype=decimal&latitude='+center_lonlat.lat+'&longitude='+center_lonlat.lon+'&zoom='+%20(g_cartouche.map.zoom+12));})();
Last edited by trojaneel on Wed Mar 10, 2010 5:20 pm, edited 6 times in total.
Area Manager - Haarlem (NL) and Amsterdam (NL)
trojaneel
 
Posts: 96
Joined: Mon Nov 16, 2009 11:09 pm
Location: The Netherlands
Has thanked: 0 time
Been thanked: 0 time

Re: Bookmarklet to open Google Maps

Postby libora » Fri Nov 20, 2009 1:56 pm

Thanks a lot, its great script. Only one note - in waze window i got blank screen with message "[object Window]" and must use back function to see cartouche
HTC EVO 3D a Waze 3.6.0 for Android
Informace pro editory, Přehledné video v angličtině
libora
Area Manager
Area Manager
 
Posts: 665
Joined: Fri Sep 25, 2009 3:02 pm
Location: Chomutov, Praha, Moldava Czech Republic
Has thanked: 1 time
Been thanked: 15 times

Re: Bookmarklet to open Google Maps

Postby robin1979 » Fri Nov 20, 2009 1:57 pm

Doesn't help me, it changes the world for me 8-)
Especially the zoom-level touch, brilliant!
MapSquadEurope
Area Manager - Europe
robin1979
 
Posts: 3032
Joined: Thu Sep 10, 2009 6:49 am
Location: EUROPE
Has thanked: 7 times
Been thanked: 38 times

Re: Bookmarklet to open Google Maps

Postby robin1979 » Fri Nov 20, 2009 2:04 pm

LiborA wrote:Thanks a lot, its great script. Only one note - in waze window i got blank screen with message "[object Window]" and must use back function to see cartouche


Code: Select all
javascript:(function(){window.open('http://maps.google.com/maps?q=' + g_cartouche.map.center.lat + ', ' + g_cartouche.map.center.lon + '&z=' + (g_cartouche.map.zoom + 12));})();
MapSquadEurope
Area Manager - Europe
robin1979
 
Posts: 3032
Joined: Thu Sep 10, 2009 6:49 am
Location: EUROPE
Has thanked: 7 times
Been thanked: 38 times

Re: Bookmarklet to open Google Maps

Postby trojaneel » Fri Nov 20, 2009 2:07 pm

robin1979 wrote:
LiborA wrote:Thanks a lot, its great script. Only one note - in waze window i got blank screen with message "[object Window]" and must use back function to see cartouche


Code: Select all
javascript:(function(){window.open('http://maps.google.com/maps?q=' + g_cartouche.map.center.lat + ', ' + g_cartouche.map.center.lon + '&z=' + (g_cartouche.map.zoom + 12));})();


Thanks, Robin! My browser (Google Chrome) didn't do that, so I didn't notice.

I updated my post at the top with the new code.
Area Manager - Haarlem (NL) and Amsterdam (NL)
trojaneel
 
Posts: 96
Joined: Mon Nov 16, 2009 11:09 pm
Location: The Netherlands
Has thanked: 0 time
Been thanked: 0 time

Re: Easy way to find out where you are on the map

Postby trojaneel » Fri Nov 20, 2009 5:56 pm

I've updated the code at the top again. I noticed that when the center of a map was on a highway, it would center on some other part of the highway, even though it would place a green marker in the right place (off screen).

New code fixes that.
Area Manager - Haarlem (NL) and Amsterdam (NL)
trojaneel
 
Posts: 96
Joined: Mon Nov 16, 2009 11:09 pm
Location: The Netherlands
Has thanked: 0 time
Been thanked: 0 time

Re: Easy way to find out where you are on the map

Postby mattismyname » Fri Nov 20, 2009 7:30 pm

That's fantastic!

I often keep OSM and bing maps open as well during editing (you'd be surprised how often they give different answers). Anybody have bookmarklets for those?
mattismyname
 
Posts: 9
Joined: Sun Sep 27, 2009 12:58 am
Has thanked: 0 time
Been thanked: 0 time

Re: Easy way to find out where you are on the map

Postby trojaneel » Fri Nov 20, 2009 7:56 pm

mattismyname wrote:I often keep OSM and bing maps open as well during editing (you'd be surprised how often they give different answers). Anybody have bookmarklets for those?


Sure! Whatever makes you happy...

OpenStreetMap:
Code: Select all
javascript:(function(){window.open('http://www.openstreetmap.org/?mlat=' + g_cartouche.map.center.lat + '&mlon=' + g_cartouche.map.center.lon + '&zoom=' + (g_cartouche.map.zoom + 12));})();


Bing:
Code: Select all
javascript:(function(){window.open('http://www.bing.com/maps/?cp=' + g_cartouche.map.center.lat + '~' + g_cartouche.map.center.lon + '&where1=' + g_cartouche.map.center.lat + ',' + g_cartouche.map.center.lon + '&lvl=' + (g_cartouche.map.zoom + 12));})();


Strangely enough, the zoom levels for each of them seem to be more or less the same. That is, all 12 higher than Waze. May need refinement.
Area Manager - Haarlem (NL) and Amsterdam (NL)
trojaneel
 
Posts: 96
Joined: Mon Nov 16, 2009 11:09 pm
Location: The Netherlands
Has thanked: 0 time
Been thanked: 0 time

Re: Easy way to find out where you are on the map

Postby robin1979 » Fri Nov 20, 2009 8:04 pm

mattismyname wrote:That's fantastic!

I often keep OSM and bing maps open as well during editing (you'd be surprised how often they give different answers). Anybody have bookmarklets for those?


This one opens OSM and Bing as well (zoom level will not be correct for bing, need to fix that someday 8-) ), just a quick hack:

Code: Select all
javascript:(function(){
var lat = g_cartouche.map.center.lat;
var lon = g_cartouche.map.center.lon;
var zoom = g_cartouche.map.zoom;
var ll =  lat + ',' + lon;
window.open('http://maps.google.com/maps?q=' + ll + '&ll=' + ll + '&z=' + (zoom + 12));
window.open('http://www.openstreetmap.org/?lat='+lat+'&lon='+lon+'&zoom=' + (zoom + 12));
window.open('http://www.bing.com/maps/?v=2&where1='+ll);
})();
MapSquadEurope
Area Manager - Europe
robin1979
 
Posts: 3032
Joined: Thu Sep 10, 2009 6:49 am
Location: EUROPE
Has thanked: 7 times
Been thanked: 38 times

Re: Easy way to find out where you are on the map

Postby trojaneel » Fri Nov 20, 2009 8:09 pm

Alright... too many bookmarklets now. I think that is enough.

If you want a bookmarklet that opens everything at once, and that has Bing at the right zoom level: look at my code for Bing and put it in robin1979's code :-)

robin1979: I noticed Bing only zooms if you supply the coordinates in the cp parameter as well.
Area Manager - Haarlem (NL) and Amsterdam (NL)
trojaneel
 
Posts: 96
Joined: Mon Nov 16, 2009 11:09 pm
Location: The Netherlands
Has thanked: 0 time
Been thanked: 0 time

Next

Return to Waze Map Editor

Who is online

Users browsing this forum: Nomenclator1677