GithubHelp home page GithubHelp logo

Comments (1)

eschwartz avatar eschwartz commented on September 4, 2024

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:

var gmapsKml = kml.getView();
gmapsKml.setZIndex(100);

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) {|
  var infobox = new aeris.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.

from aerisjs.

Related Issues (15)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.