"My Location" in Google Maps javascript API - google-maps-api-3

Is there a way to use the "My location" button that exist on Google Maps in your own webbapplication using the javascript api?
I have read about adding controls here Google Maps Javascript API V3 Controls but I haven't found anything about the "My locaton" control.

There's currently no geolocation button in Google Maps API v3. But it's not difficult to implement one yourself.
Information about implementing geolocation can be found in the Google Maps Javascript API documentation.
If you want to add a geolocation button as a map control, read the Custom Controls section of the Google Maps documentation.

Related

How to add Bing Map to Web Page?

I tried to add bing map with place I marked on it, but it didn't work? I followed these steps:
Login to http://www.bing.com/maps
Click on My Places
Create New List
Under that one I have marked place i want
Click on share button
Copy embed in a web page code and paste it on my page.
But I can't see place I marked, can someone please tell me what is the wrong thing I did?
thank you
You can't embed My Place's maps into a website. The My Places functionality is only available on the Bing Maps consumer site.
If you want to include a map on your website with data on it you have to use the Bing Maps development API's. Here are some resources to get you started:
Bing Maps V7 documentation
Bing Maps V7 Interactive SDK
Bing Maps Blog
Bing Maps Forums

Google places on Mapbox map

I want to add Google places to the Mapbox map on my site. I don't pre-fetch, fetch or store them in any database. Is it possible to use the API to post the places on my custom map or am I violating Google Maps terms of use?
This would break the Google Places Terms of Service
If your application displays Places API data on a map, that map must be provided by Google.
You might want to use the Foursquare API instead.

Dynamically addressing kml in Google Earth API for Google Maps v3

I'm using Google Earth API for Google Maps v3 to display kml files in a window which can then be switched between Maps and Earth browsers. This is a different plugin to that officially provided by Google, and I've run into a problem dynamically switching kml in the Earth window. I use checkboxes to switch them in the Maps API V3, window, but when the browser is switched to Earth it no longer listens to the checkbox actions. Essentially what I'm trying to do is a replication of the interactive checkbox example on the google code playground, but I think I should be using the Maps V3 scripts?
I've included a link to the example script here:
http://commondatastorage.googleapis.com/webgistank/TRMM_Checkbox_Example.html
Any help is greatly appreciated!
Regards,
Kerry
You have errors in your code. For example, the line
google.maps.event.addListenerOnce(map, 'tilesloaded', addOverlays);
references the non-existent function addOverlays
Also, I'm not sure what you mean...
"This is a different plugin to that officially provided by Google"
...as it is the exact same plugin.
You also state that...
"...it no longer listens to the checkbox actions."
It is the browser listens for the actions, not the Earth plug-in. The checkboxs event are still firing, the reason the code doesn't work is that the "Google Earth Api" (the api for controlling the plugin) uses totally different objects and methods to the Google Maps Api (the api for controlling the map). Things like google.maps.KmlLayer just don't exist in the Earth Api at all. So when the checkbox event fires it causes and error because you are calling methods on objects that don't exist.
From looking at your code, after initialising the Earth plugin via
googleEarth = new GoogleEarth(map);
You don't do anything else with it...You mention in your question the interactive checkbox example on the Google code playground, but as far as I can see you haven't actually implemented any of the code from that example.
Take another look at the function loadKml method in that example - it clearly shows how to load and display data in the Earth plugin.

Merging the StreetView Control (Pegman) and Zoom Control in Google Maps JavaScript API

Is there a way to configure the Google Maps JavaScript API (v3) such that the StreetView (pegman) and Zoom Controls are touching, just like maps.google.com? I believe I have tried all of the configuration options and can't get them to touch.

Google map mobile jquery api Location and Direction

Hey I'm new with google map api. Please let me know if I can make an app which shows current location and direction at the same time.
You can use jQuery mobile with Google maps v3 plugin.
Google maps v3 plugin for jQuery, jQuery UI and jQuery Mobile takes away some of the head aches from working with the Google Map API. Instead of having to use Google event listeners for simple events like click, you can use jQuery click events on the map and markers.
[Exmaples]
Basic map example
Basic map example with geolocation

Resources