You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
var kml = new aeris.maps.layers.AdvisoriesKML('http://gis.hamweather.net/kml/hwwarnings.kml');
kml.setMap(map);
var kmlLayer = new google.maps.KmlLayer({
url: 'http://gis.hamweather.net/kml/hwwarnings.kml',
suppressInfoWindows: false,
preserveViewport: true,
map: googleMap
});
google.maps.event.addListener(kmlLayer, 'click', function(kmlEvent) {
var text = kmlEvent.featureData.description;
showInContentWindow(text);
});
There doesn't seem to be a function, kml.setZIndex (or set the opacity of any loaded KMLs)
No matter what, I cannot seem the set the KML layer to be under the radar image. Is this a limitation of gmaps+KML? For example, on the hamweather.com main page, you can see this behavior where the radar image is 'behind' the advisory.
The text was updated successfully, but these errors were encountered:
google.maps.KmlLayer does support a setZIndex method, though I would guess that it's only relative to other KML layers, so you may not be able to change its zIndex in relation to a radar layer. Aeris.js does not currently support a aeris.maps.layers.KML#setZIndex method, though you could directly call the method on the underlying gmaps view:
Note that the google.maps.ImageMapType which is used to render tile layers does not support setting zIndex. I had to implement a custom ImageMapType object to handle z-indexes.
The reason we can use zIndexes on the HAMWeather page is that we're using aeris.maps.layers.Advisories, which is a tile image layer, not a kml layer.
A couple other things:
1: You can use the base aeris.maps.layers.KML layer. The AdvisoriesKML layer is simply a version of the KML layer, configured to use the http://gis.hamweather.net/kml/hwadv_all.kml endpoint. Also, note that KML accepts an attrs object, not a uri string as a constructor argument:
var kml = new aeris.maps.layers.KML({
url: ''http://gis.hamweather.net/kml/hwwarnings.kml'
});
2: It looks like you're creating two KML layer object -- one Aeris.js object, and another gmaps object. I'm guessing that this is not what you're trying to do. If you're trying to get access to a click event, you can do so directly through the aeris object:
kml.on('click',function(latLon,data){|varinfobox=newaeris.maps.InfoBox({position: latLon,content: data.description});infoBox.setMap(map);// or whatever else you want to do here.});
3: The aeris KML layer is currently setup to hardcode the suppressInfoWindows option as true. It would be nice if this wasn't hardcoded, though I did that in order to keep the behavior consistent with other mapping libraries. The good news is that's it's easy enough to popup your own info windows on click (as shown above).
The documentation for all this is sparse, to put it generously -- we're working on that. If you haven't yet, I would suggest taking a peek at the API reference docs. It's not super user-friendly, but it does list out all of the object attributes, events, and methods, which can be helpful.
Take for example this code:
There doesn't seem to be a function, kml.setZIndex (or set the opacity of any loaded KMLs)
No matter what, I cannot seem the set the KML layer to be under the radar image. Is this a limitation of gmaps+KML? For example, on the hamweather.com main page, you can see this behavior where the radar image is 'behind' the advisory.
The text was updated successfully, but these errors were encountered: