简体   繁体   中英

Use the standard google maps interface on embedded maps / google maps API

This surely sounds like a silly question in my head, but I want to put it out there nonetheless just to make sure I haven't missed anything.

I've got a page on my website that has a google map (currently 'embedded' through the google maps api v3). While I'm perfectly capable of interacting with that map through a custom form (and the google map api):

an input box to set starting point
an input box to set endpoint
a dropdown list for transportation modes

I was wondering if it was possible (in comes the silliness) to use google's own interface for this (cause users are used to this).

Abstracting my question: Is there a way to "bring in" Google Maps' own UI on an embedded map and do some calculations on my own page, based on the routes (/modes of transportations, etc) that are being selected in that UI.

My guess: no. The google maps UI is something that can only show up on maps embedded with an iFrame (so only on maps.google.com) and no interaction with it is possible, at least not in a kosher way.

我要实现的目标的简短概述

There is the direction API which you can use to obtain responses (JSON or XML) regarding useful information such as distance, start coordinate, travel mode, etc. You can interact with the response to obtain what is needed for your web page.

I have posted a link for the direction API. Hope this can help.

Direction API

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM