GoogleMaps V3 KML: change markersize on zoom - google-maps-api-3

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

Related

label a kml file in Google Maps API v3

I am trying to figure out how to use Google Maps API v3 to label a kml polyline that was originally created in ArcGIS Desktop. Unfortunately, the examples that I came across thus far either don't seem to apply to kml files, had dead links, or were examples on how to create pop-ups.
If anyone has an example of how to create labels (not popups) from a kml file let me know.
Side questions:
*In ArcGIS I can use Layer->Properties->HTML Popup to configure the popup for kml. What do I need to do in ArcGIS to specify what attribute I want to use as my label?
*Can I make labels appear only at certain resolutions?
You can't add labels using the Google Maps Javascript API KmlLayer, if your KML isn't too complicated, you can use a third party parser (like geoxml3 or geoxml-v3) to render your KML as native Google Maps Javascript API v3 Polylines, and add labels to those.
labeling options:
polyline with label in javascript
MapLabel
InfoBox

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.

Google Maps JS API V3 - Create map and insert fake labels over locations

I'm mocking up an HTML5 web app and I need to incorporate a map with specific locations marked off with custom banners. For the sake of the mockup, I just need to have the default location markers replaced with some sort of graphic of my choosing. How would I do this?
The Maps API documentation has a custom marker icon example (reference). You can use it as a starting point for your own code.

google map custom markers in kmlLayer

I have a problem loading the google map custom markers in kmlLayer.
The custom markers become very tiny recently.
http://apdrc.soest.hawaii.edu/gg/rainSD2.php
It was working before. Does anyone know the problem on that?
Is that the google map API server problem?
Does google map API change the setting for custom markers size?
Thanks for helping.
Google announced a change to KML rendering that was scheduled to take place in mid-July. It wouldn't surprise me if this included support of the scale tag. Are your icons not standard sized? Should they be scaled?
Looking at your KML, you are scaling your icons:
<scale>0.25</scale>
If you apply that to your icons which are 32x32, they end up being 8x8, and the dot is already a pretty small chunk of the real estate.
If you change the scale to 1.0, I think it will display as you expect (once the cache on google's servers updates).

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

Resources