0

This is my JavaScript button:

<input type="button" onclick="map.setView({ center : new Microsoft.Maps.Location(48.857, 2.333), zoom: 13})" value="Paris"/> 

I would like to create a URL for this button i.e. GitHub.com/paris.

I have received the following advice:

If you want a URL to a map on your page you can use query parameters and then parse those and process them as needed.

Any advice on how to do this would be much appreciated.

Nick
  • 3
  • 1
  • I’d recommend using [the second answer by Andy E](http://stackoverflow.com/a/2880929/707111) in the duplicate; the accepted one isn’t very good. – Ry- Mar 11 '17 at 01:07
  • Thanks Ryan. I'm new to this & I can't figure out Andy E's code i.e. where does my onclick function go ... what is my new URL. – Nick Mar 11 '17 at 06:37
  • If you `console.log(urlParams);` after including that snippet on a page with query parameters (`https://example.com/your-page?latitude=48.857&longitude=2.333&zoom=13`), you’ll get an idea of the structure you have to work with. – Ry- Mar 11 '17 at 07:04

0 Answers0