Google maps api v3, bus stops mouse over info - google-maps-api-3

I am using Google maps api v3 to show shops selling our products on map by adding custom markers. There are visible icons of public transport stops (bus, tram, etc.) on the map but the info of what line number stop there is not showing when mouse over such icon. (The info shows when I check the same place on normal google map) Is is possible to turn it on on my map too?

Google embeds clickable points of interest in the map, with their own info.
If you add your own marker, you still need to add your desired info to that marker, then set an event listener on the mouseover event to display an infobox, and append the marker info to a nicely formatted html into that infobox.
A simpler way would be to set the title property of the marker, that will by default show up on mouseover, but it'll be just some text.
You could use the google places api that comes as a module of google maps library to find those transit stops and parse the place details, but that's way ahead in the learning curve.

Related

Custom Google StreetView with markers

I was wondering if you could put a custom StreetView with a marker. I am making a map that has city parks. I want it so if someone clicks on a specific marker, the custom StreetView pops up and shows the panorama. For the custom StreetViews I used Google Views. Is this possible?
Thanks in advance.
Yes, this is possible. Something close to it can be done in two ways.
The easiest option is to load Google maps from the main URL and wait. It will let you build a map or view your custom maps just below the search bar. Google Maps itself lets you create a custom map with markers. This doesn't sound like your desired option, but it is quick to implement. You can even add your own style.
The second is to create your own custom Street View tour, this sounds like your focus. You want the actual panographs to use your markers. This is fairly easy to do, but requires some programming. It is possible on both Google Earth and Google Maps. Check out the Google APIs such as https://developers.google.com/maps/documentation/javascript/reference#StreetViewPanoramaOptions. Options include changing out panographs for your own images, defining arrows including labels, overlays, pop-up boxes, action boxes, and more. Check out some options here: http://hpneo.github.io/gmaps/examples.html

Prevent user from adding markers on ocean/river in google map api v3

I have implemented a map using google map api v3, where users can add a marker dynamically and give their feedback through a form in infowindow which pop-up while adding the marker.
I want to prevent users from adding the marker on ocean/river area.
I have searched solution for this requirement and I got this answer, unfortunately the html5 canvas method explained there was for static map but I need this for dynamic one.
Please help!
For oceans and seas
You can use elevation api as in this example:
Example
For ocenas and sees it will return negative number but:
It's not 100% accurate. For some terrains near water it returns negative numbers
It doesn't work for lakes and rivers

Any minimal or night view or overlay for google maps api v3?

The default overlays that come out of the box for Google Maps API v3 Street, terrain, etc. appear to busy. I want to have a good "night" or "minimal" overlay that is like leaflet night view or minimal view http://leafletjs.com/examples/layers-control.html (select the layer control to switch between views) or a simple white and gray map without all the business of the colors. Are there such overlays that exist or settings that could be used so that I could use it/customize it for my Google Map?
You can create your own style. Here is the documentation
https://developers.google.com/maps/documentation/javascript/styling
Included is a style wizard that generates all the JSON for you
http://gmaps-samples-v3.googlecode.com/svn/trunk/styledmaps/wizard/index.html

Close InfoWindow for local business marker

I have a new google map app using v3 of the API. On it I have a few custom markers with info windows. I use a global variable to ensure only one info window opens at any one time - everything is as it should be.
However the map comes with many local business markers, just like the ones all over this map (http://goo.gl/maps/M6m3), all of which open their own infowindows. If I click on one of these my infowindow doesn't get closed, and if I click on one of my markers, the built in infowindow also doesn't close - leaving multiple windows open.
Can this be resolved?
Sounds like you want the "Points of Interest" (AKA POI) on the map to not be clickable (or to be able to capture the click on them).
This was tracked as an FR in the issue tracker and was recently implemented using a new property clickableIcons in MapOptions
If you set it to false, POI features will no longer be clickable. You can also use the get/setClickableIcons methods on the Map object to change this dynamically.
One other way to deal with them is to remove POIs from the map (using styled maps), if you don't want to have the infowindow open when they are clicked.
Here (How to remove certain places on a map ) is one discussion on the v3 API group about using styled maps to remove them.
And here (Disabling POI's InfoWindows - workaround found) is another.
At least now it doesn't cost more to do that (styled maps used to be more expensive than normal maps).

Custom info window for route plotted through DirectionService

Using the Google Maps API v3, is it possible to customize the layout and content of the infoWindows that are attached to each route marker that's plotted through the DirectionService?
Thanks to geocodezip at the Google Maps API Groups for this example on how to achieve this:
http://www.geocodezip.com/v3_directions_custom_revgeo.html
There is no out of the box way to do it, you have to essentially place custom markers/infoWindows yourself, and attach dragging listeners to each one of them.

Resources