James Ashton
James Ashton

Reputation: 9

Getting links to web services from a Google map

I often see many maps created in different API's and want to pick the best of them all to create my own mashup. Easy to do when debugging other API's like ESRI Javascript API I can get a rest end point in view source and use it in other GIS "viewers" and API's. But when I come up against a google map like this http://wildfire.alberta.ca/wildfire-status/wildfire-status-map.aspx

I cannot seem to debug and find a "service url" that I can say plug into another GIS client like ArcGIS Online. Is there such a thing as a underlying web accessible KML that I can snag - out of the above example?

Upvotes: 0

Views: 78

Answers (1)

geocodezip
geocodezip

Reputation: 161374

That URL is using the Google Maps Javascript API v3 KmlLayer to render KML.

// Add static regions KML
var regionsLayer = new google.maps.KmlLayer({
    url: 'http://wildfire.alberta.ca/apps/wildfirestatusmap/DataFiles/esrd_wma.kmz'
});
regionsLayer.setZIndex(1);
regionsLayer.setMap(map);

// Add dynamic markers
var wildfiresLayer = new google.maps.KmlLayer({
    //url: 'http://wildfire.alberta.ca/wildfire-status/status-map-handler.ashx?type=map'
    url: 'http://wildfire.alberta.ca/apps/wildfirestatusmap/status-map-handler.ashx?type=map'

});
wildfiresLayer.setZIndex(10);
wildfiresLayer.setMap(map);

code snippet:

function initialize() {
  var map = new google.maps.Map(
    document.getElementById("map_canvas"), {
      center: new google.maps.LatLng(37.4419, -122.1419),
      zoom: 13,
      mapTypeId: google.maps.MapTypeId.ROADMAP
    });
  // Add static regions KML
  var regionsLayer = new google.maps.KmlLayer({
    url: 'http://wildfire.alberta.ca/apps/wildfirestatusmap/DataFiles/esrd_wma.kmz'
  });
  regionsLayer.setZIndex(1);
  regionsLayer.setMap(map);

  // Add dynamic markers
  var wildfiresLayer = new google.maps.KmlLayer({
    //url: 'http://wildfire.alberta.ca/wildfire-status/status-map-handler.ashx?type=map'
    url: 'http://wildfire.alberta.ca/apps/wildfirestatusmap/status-map-handler.ashx?type=map'

  });
  wildfiresLayer.setZIndex(10);
  wildfiresLayer.setMap(map);
}
google.maps.event.addDomListener(window, "load", initialize);
html,
body,
#map_canvas {
  height: 100%;
  width: 100%;
  margin: 0px;
  padding: 0px
}
<script src="https://maps.googleapis.com/maps/api/js"></script>
<div id="map_canvas"></div>

Upvotes: 1

Related Questions