123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160 |
- define("dojox/geo/openlayers/widget/Map", ["dojo/_base/kernel",
- "dojo/_base/declare",
- "dojo/_base/array",
- "dojo/_base/html",
- "dojo/query",
- "dijit/_Widget",
- "dojox/geo/openlayers/Map",
- "dojox/geo/openlayers/Layer",
- "dojox/geo/openlayers/GfxLayer"], function(dojo, declare, array, html, query, Widget, Map, Layer, GfxLayer){
-
- return declare("dojox.geo.openlayers.widget.Map", Widget, {
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- baseLayerType : dojox.geo.openlayers.BaseLayerType.OSM,
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- initialLocation : null,
-
-
-
-
-
-
- touchHandler : false,
-
-
-
- map : null,
- startup : function(){
-
-
- this.inherited(arguments);
- this.map.initialFit({
- initialLocation : this.initialLocation
- });
- },
- buildRendering : function(){
-
-
-
-
- this.inherited(arguments);
- var div = this.domNode;
- var map = new Map(div, {
- baseLayerType : this.baseLayerType,
- touchHandler : this.touchHandler
- });
- this.map = map;
- this._makeLayers();
- },
- _makeLayers : function(){
-
-
-
-
- var n = this.domNode;
- var layers = query("> .layer", n);
- array.forEach(layers, function(l){
- var type = l.getAttribute("type");
- var name = l.getAttribute("name");
- var cls = "dojox.geo.openlayers." + type;
- var p = dojo.getObject(cls);
- if (p) {
- var layer = new p(name, {});
- if (layer)
- this.map.addLayer(layer);
- }
- }, this);
- },
- resize : function(b){
-
-
-
-
-
-
-
-
-
- var olm = this.map.getOLMap();
- var box;
- switch (arguments.length) {
- case 0:
-
- break;
- case 1:
-
- box = dojo.mixin({}, b);
- dojo.marginBox(olm.div, box);
- break;
- case 2:
-
- box = {
- w : arguments[0],
- h : arguments[1]
- };
- dojo.marginBox(olm.div, box);
- break;
- }
- olm.updateSize();
- }
- });
- });
|