david-r-edgar / MapSwitcher

Chrome extension to switch between different mapping websites
MIT License
25 stars 7 forks source link

Apple maps link #36

Open cpo-ux opened 10 months ago

cpo-ux commented 10 months ago

Hi, thanks for the great extension.

I'd like apple maps links to be added, example below:

https://maps.apple.com/?q=81.673184,-120.798333

david-r-edgar commented 10 months ago

Thanks for the request. Yes, that would be useful.

It does have a bit of a difference to other services in that it apparently just redirects to google maps on non-Apple devices. So it probably wouldn't make much sense to show it on linux or windows, for example.

It would be possible just to ignore it for non-supported platforms based on the agent string, when building the links. But maybe it would be better to use the agent string to initially configure it as enabled/disabled. And then the user could override this if necessary.

cpo-ux commented 10 months ago

Hi David, I don't have an iPhone. I started looking into this only because I wanted to give this type of link to iOS users. So for myself I'd like the ability to generate an apple maps link from windows. I also found out later that an Apple maps URL can be created in such a way that it will open on other platforms. That works with this type of link:

https://maps.apple.com/place?q=Here&ll=32.7502202,-114.765537

It doesn't matter what string is used after q= just as long as you're using both q= and ll= it will open apple maps on other platforms. Give it a try. Scroll mouse zoom doesn't work on chrome browser but otherwise it works fine. If you were to configure this type of apple maps link I think it would be good to have the lat and long in the part after the q= so like this:

https://maps.apple.com/place?q=32.7502202,-114.765537&ll=32.7502202,-114.765537

That's my 2 cents. Thanks again for the great extension.

More info:

https://developer.apple.com/library/archive/featuredarticles/iPhoneURLScheme_Reference/MapLinks/MapLinks.html