Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save oleglukashev/885af684cb27d047a4f935de986d8744 to your computer and use it in GitHub Desktop.
Save oleglukashev/885af684cb27d047a4f935de986d8744 to your computer and use it in GitHub Desktop.
for agency
Map.prototype.generateMap = function(cities_settings) {
this.terrain = new Agency9.Layer.A3XTerrainLayer("terrain", cities_settings.terrain);
this.terrain.setFocusOnTerrain(false);
this.instance.addLayer(this.terrain);
this.buildings_layer_geometry_style = new Agency9.Model.GeometryStyle();
this.buildings_layer_model_style = new Agency9.Style.ModelStyle();
this.buildings_layer_model_style.setGeometryStyle(this.buildings_layer_geometry_style);
this.buildings_layer = new Agency9.Layer.CachedFeatureLayer("buildings", cities_settings.buildings_urls);
this.buildings_layer.setStyle(this.buildings_layer_model_style);
this.instance.addLayer(this.buildings_layer);
this.hover_style = new Agency9.Model.GeometryStyle();
this.hover_style.setHighlightColor(cities_settings.hover_green_color);
this.selected_style = new Agency9.Model.GeometryStyle();
this.selected_style.setHighlightColor(cities_settings.select_green_color);
this.balloon_layer = new Agency9.Layer.FeatureLayer("balloonlayer", this.terrain.getMirroredLayerSettings());
this.balloon_layer.setLodMaxLevel(0);
this.point = new Agency9.Feature.Point(cities_settings.default_coordinate_a, cities_settings.default_coordinate_b, cities_settings.default_coordinate_c); // Berlin
this.balloon = new Agency9.Balloon();
this.balloon.setVisible(false);
this.balloon.setStylename("balloon");
this.balloon.setOffsetX(cities_settings.baloon_offset_a);
this.balloon.setOffsetY(cities_settings.baloon_offset_b);
this.point.setBalloon(this.balloon);
this.balloon_layer.addFeature(this.point);
this.instance.addLayer(this.balloon_layer);
}
Map.prototype.clearMap = function() {
this.instance.removeLayer(this.balloon_layer);
this.instance.removeLayer(this.terrain);
this.instance.removeLayer(this.buildings_layer);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment