codesite-noreply at google.com
2009-Dec-13 19:22 UTC
[Mapstraction] [mapstraction] r63 committed - Working on updating GeoCommons provider
Revision: 63 Author: ajturner Date: Sun Dec 13 11:09:56 2009 Log: Working on updating GeoCommons provider http://code.google.com/p/mapstraction/source/detail?r=63 Modified: /trunk/source/mxn.geocommons.core.js /trunk/source/mxn.js /trunk/tests/index.htm ======================================--- /trunk/source/mxn.geocommons.core.js Sun Aug 23 19:47:00 2009 +++ /trunk/source/mxn.geocommons.core.js Sun Dec 13 11:09:56 2009 @@ -5,9 +5,26 @@ init: function(element, api) { var me = this; this.element = element; - Maker.maker_host=''http://maker.geocommons.com''; - Maker.finder_host=''http://finder.geocommons.com''; - Maker.core_host=''http://geocommons.com''; + // Maker.maker_host=''http://maker.geocommons.com''; + // Maker.finder_host=''http://finder.geocommons.com''; + // Maker.core_host=''http://geocommons.com''; + F1.Maker.maker_host=''http://localhost:4002''; + F1.Maker.finder_host=''http://localhost:4001''; + F1.Maker.core_host=''http://localhost:4000''; + url = 7566; + this.loaded[this.api] = false; // Loading will take a little bit. + new F1.Maker.Map({map_id:url, dom_id:this.element.id, + onload: function(map){ + me.maps[me.api] = map; + me.loaded[me.api] = true; + console.log("Map loaded, calling methods for " + me.api); + + for (var i = 0; i < me.onload[me.api].length; i++) { + console.log("calling method: " + i); + me.onload[me.api][i](); + } + }}); + }, applyOptions: function(){ @@ -149,8 +166,9 @@ addOverlay: function(url, autoCenterAndZoom) { var map = this.maps[this.api]; var me = this; - Maker.load_map(this.element.id, url); - setTimeout(function() { me.maps[me.api] = swfobject.getObjectById(FlashMap.dom_id);}, 500); + new F1.Maker.Map({map_id:url, dom_id:this.element.id, + onload: function(map){ me.maps[me.api] = map }}); + // setTimeout(function() { me.maps[me.api] = swfobject.getObjectById(FlashMap.dom_id);}, 500); }, addTileLayer: function(tile_url, opacity, copyright_text, min_zoom, max_zoom) { ======================================--- /trunk/source/mxn.js Wed Dec 2 16:39:48 2009 +++ /trunk/source/mxn.js Sun Dec 13 11:09:56 2009 @@ -122,7 +122,6 @@ } }, - /* checkLoad: function(funcDetails){ if(this.loaded[this.api] === false) { var scope = this; @@ -131,7 +130,6 @@ } return false; }, - */ /** * Bulk add some named events to an object. ======================================--- /trunk/tests/index.htm Sun Dec 13 11:09:44 2009 +++ /trunk/tests/index.htm Sun Dec 13 11:09:56 2009 @@ -5,11 +5,16 @@ <title>Mapstraction V2 demo</title> <script type="text/javascript" src="http://maps.google.com/maps?file=api&v=2&key=ABQIAAAAY70wuSo0zF3ZtJVp5bDm1BS1Y2ErAqCHV5rDhHSzgjy23KqwdRRaoSBuZk72oDzzAYxVBjtsLqSmTw"></script> - <script type="text/javascript" src="http://api.maps.yahoo.com/ajaxymap?v=3.8&appid=5wTxDW_V34GQjK.7glLG6OnJSRxCvfLj7ktMsuOoR42Gkm16vDVEjjw6FGWJ1Gky"></script> + + <!-- <script type="text/javascript" src="http://api.maps.yahoo.com/ajaxymap?v=3.8&appid=5wTxDW_V34GQjK.7glLG6OnJSRxCvfLj7ktMsuOoR42Gkm16vDVEjjw6FGWJ1Gky"></script> <script charset="UTF-8" type="text/javascript" src="http://ecn.dev.virtualearth.net/mapcontrol/mapcontrol.ashx?v=6.2"></script> - <script src="http://openlayers.org/api/OpenLayers.js"></script> - - <script src="../source/mxn.js?(google,yahoo,microsoft,openlayers)" type="text/javascript"></script> + <script src="http://openlayers.org/api/OpenLayers.js"></script> + + <script src="../source/mxn.js?(google,yahoo,microsoft,openlayers)" type="text/javascript"></script> --> + <script charset="UTF-8" type="text/javascript" src="http://localhost:4002/javascripts/embed.js"></script> + + <!--<script src="domReady.js" type="text/javascript"></script>--> + <script src="../source/mxn.js?(google, geocommons)" type="text/javascript"></script> <script type="text/javascript"> //<![CDATA[ @@ -38,7 +43,12 @@ var infoElm = document.getElementById(''info''); var eventsElm = document.getElementById(''events''); +<<<<<<< HEAD:tests/index.htm m = new mxn.Mapstraction(''map'', ''google''); +======+ var m = new mxn.Mapstraction(''map'', ''geocommons''); + m.addOverlay(7566); +>>>>>>> Working on updating GeoCommons provider:tests/index.htm m.endPan.addHandler(function(sEvtName, oEvtSource, oEvtArgs){ var center = oEvtSource.getCenter();