Close InfoWindow for local business marker - google-maps-api-3

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).

Related

Google maps api v3, bus stops mouse over info

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.

How is the LOD set in Google Earth API when NOT using KML for placemarks

I am dynamically setting placemarks into a Google Earth instance using the GE API.
The problem I have is that the pins are very close and they force a behaviour where you must click the group of pins and they will split off. I want to remove this behaviour and have seen there is an LOD setting relating to using KML lists of locations.
I'm not using KML, but am calling the API functions to create my placemarks.
Can I still use the LOD setting in this context? Or is there any other way to change the 'grouping' behaviour of placemarks in GE?
Sorry no, AFAIK there is absolutely no way to change the clustering/grouping behaviour of placemarks that are geographically located close together.

Is it possible to create a 'splash' screen using the Google Maps API?

I have built a custom Google Map and When the page loads I would like a 'splash screen' to appear over the map inside the map container (this would be an image with some instructions), which could then either be toggled off or would disappear after a set time.
I know that I can do this using CSS/JQuery to create a layer over the map container, but is it possible to do this using the map API?
You could use overlays or a custom infowindow (infobox).
I would suggest overlays. Their existence is for displaying components
over the map. Infowindow would suffice too, but their role is for displaying something
in relation to a specific spot on the map.
See this for more

How to create placemarks manually as in "My Maps"

I have a fully functioning map using the API v3 with markers placed as a result of database searches, and info windows that pop up correctly. So far, so good.
What I would like to do is to allow the user to place a marker on the map manually, i.e by dragging and dropping a placemark in exactly the same way as google "My Maps" uses to build a map or by clicking on the map.
There are several reasons for doing this, but one is that I would like the user to easily identify a centre point of interest so that I can filter searches within a radius of this point.
I would have thought that this option would be useful to others.
Maybe I am using the wrong search terms for this, and the terms "marker" and "placemark" seem to be interchangeable, which doesnt help, but I cannot formulate a search which has even shown that anyone else is trying to do this.
Have you seen this example of the drawing tools, it allows you to add Markers, Polylines and Polygons, you can customize it to just do Markers.
Here is the documentation for the Drawing Manager

GoogleMaps V3 KML: change markersize on zoom

I'm currently working on a new projekt using GoogleMaps V3 and kml layers.
What I'm currently trying to achieve is to change the size of my markers on the fly, depending on the zoomlevel.
After searching a bit I found this post which basically tells me that I can't scale the icons in the kml layer after the layer has been loaded. GoogleMaps V3 KML PlaceMark StyleURL change
So it seems that I'm left with three options here...
1. Make one kml layer for each zoomlevel.
2. Use a third party kml parser like geoxml_v3.
3. Print out all my markers directly in my js code.
If I succeed with my projekt I'm going to have tons of markers on my site which leads me to the following questions:
Which method will result in the lowest loadingtime for my visitors webbrowsers if the map is full of markers?
Are there any other method I should consider?
Thanks in advance!
Options:
Make one kml layer for each zoomlevel.
[~] would require ~ <20 KML files
[+] retains the advantage of KmlLayer tiled rendering
Use a third party kml parser like geoxml_v3.
[-] renders the markers using native Google Maps API v3 objects
[+] easier to access the objects externally if you want to have a clickable sidebar.
Print out all my markers directly in my js code.
[-] loses the advantage of tiled rendering
[-] large page size
The end result will depend on the number of markers (the more markers the bigger the advantage of tile based rendering), how comfortable you are with automatically generating KML files, and how your map functions (not enough information in your post to tell).

Resources