Skip to content
Browse files

de-Googling

git-svn-id: https://modestmaps.googlecode.com/svn/trunk/as3@734 a23cadb0-8de1-11de-82e5-a1837a67dc72
  • Loading branch information...
1 parent 33d4ab4 commit a892c4d99e68871802859f8e779569506e3f3577 tom committed Dec 21, 2008
View
8 build-docs.sh
@@ -0,0 +1,8 @@
+#!/bin/sh
+
+FLEX_HOME=/Applications/Adobe\ Flex\ Builder\ 3/sdks/3.2.0/;
+PROJ_PATH=/Users/tom/Documents/Stamen/ModestMapsV1/modestmaps/trunk/as3;
+
+cd "$FLEX_HOME";
+pwd
+bin/asdoc -doc-sources $PROJ_PATH/lib -output $PROJ_PATH/docs
View
50 lib/com/modestmaps/extras/MapCopyright.as
@@ -16,7 +16,7 @@ package com.modestmaps.extras
* VERY EXPERIMENTAL, requires javascript, uses this technique:
* http://www.actionscript.org/resources/articles/745/1/JavaScript-and-VBScript-Injection-in-ActionScript-3/Page1.html
*
- * TODO: update spans for Microsoft, fix slowness with Google, add Yahoo :)
+ * TODO: update spans for Microsoft, add Yahoo :)
*
* In general, lots of this needs reworking... at least, IMapProviders should be able to provide copyright strings
* without requiring javascript, and without needing to edit this file.
@@ -66,20 +66,6 @@ package com.modestmaps.extras
this.microsoft.copyright(undefined, minLat, minLon, maxLat, maxLon, zoom);
break;
- case 'GOOGLE_ROAD':
- this.google.copyright('', cenLat, cenLon, maxLat-minLat, maxLon-minLon, zoom);
- break;
-
- case 'GOOGLE_AERIAL':
- this.google.copyright('&t=k', cenLat, cenLon, maxLat-minLat, maxLon-minLon, zoom);
- break;
-
- case 'GOOGLE_HYBRID':
- this.google.copyright('&t=h', cenLat, cenLon, maxLat-minLat, maxLon-minLon, zoom);
- break;
-
- // TODO: GOOGLE_TERRAIN
-
case 'YAHOO_ROAD':
case 'YAHOO_AERIAL':
case 'YAHOO_HYBRID':
@@ -93,38 +79,6 @@ package com.modestmaps.extras
}
},
- google: {
- holders: undefined,
-
- addCopyright:
- function(holder)
- {
- if(!this.holders || !holder) {
- return;
- }
-
- var newHolder = true;
-
- for(var i = 0; i < this.holders.length; i += 1) {
- if(holder == this.holders[i]) {
- newHolder = false;
- }
- }
-
- if(newHolder) {
- this.holders.push(holder);
- document.getElementById(modestMaps.swfId).copyrightCallback(this.holders.join(', '));
- }
- },
-
- copyright:
- function(t, cenLat, cenLon, spanLat, spanLon, zoom)
- {
- this.holders = ['&copy; Google'];
- var s = document.createElement('script');
- s.src='http://maps.google.com/maps?spn='+spanLat+','+spanLon+'&z='+zoom+'&vp='+cenLat+','+cenLon+'&ev=p'+t;
- document.getElementsByTagName('head')[0].appendChild(s);
- }
},
microsoft: {
@@ -202,8 +156,6 @@ package com.modestmaps.extras
}
};
-
- GAddCopyright = function(g,a,r,b,a,g,e, holder) { modestMaps.google.addCopyright(holder); };
}
]]>
</script>;
View
14 lib/com/modestmaps/flex/MapComponent.as
@@ -26,7 +26,6 @@ package com.modestmaps.flex
import com.modestmaps.geo.*;
import com.modestmaps.mapproviders.*;
import com.modestmaps.mapproviders.microsoft.*;
- import com.modestmaps.mapproviders.google.*;
import com.modestmaps.mapproviders.yahoo.*;
import flash.events.Event;
@@ -200,7 +199,7 @@ package com.modestmaps.flex
* <modest:Map provider="{new FancyCustomMapProvider()}" .../>
*/
[Inspectable(category="Map",
- enumeration="BLUE_MARBLE,GOOGLE_AERIAL,GOOGLE_ROAD,GOOGLE_HYBRID,MICROSOFT_AERIAL,MICROSOFT_ROAD,MICROSOFT_HYBRID,YAHOO_ROAD,YAHOO_AERIAL,YAHOO_HYBRID,ZOOMIFY,OPEN_STREET_MAP,VANILLA",
+ enumeration="BLUE_MARBLE,MICROSOFT_AERIAL,MICROSOFT_ROAD,MICROSOFT_HYBRID,YAHOO_ROAD,YAHOO_AERIAL,YAHOO_HYBRID,OPEN_STREET_MAP",
defaultValue="BLUE_MARBLE")]
public function set provider(provider:*):void
{
@@ -224,15 +223,6 @@ package com.modestmaps.flex
case "MICROSOFT_ROAD":
_mapProvider = new MicrosoftRoadMapProvider();
break;
- case "GOOGLE_AERIAL":
- _mapProvider = new GoogleAerialMapProvider();
- break;
- case "GOOGLE_HYBRID":
- _mapProvider = new GoogleHybridMapProvider();
- break;
- case "GOOGLE_ROAD":
- _mapProvider = new GoogleRoadMapProvider();
- break;
case "YAHOO_AERIAL":
_mapProvider = new YahooAerialMapProvider();
break;
@@ -338,4 +328,4 @@ package com.modestmaps.flex
}
}
-}
+}
View
115 lib/com/modestmaps/mapproviders/google/AbstractGoogleMapProvider.as
@@ -1,115 +0,0 @@
-package com.modestmaps.mapproviders.google
-{
- import com.modestmaps.events.*;
- import com.modestmaps.mapproviders.AbstractMapProvider;
-
- import flash.events.Event;
- import flash.events.EventDispatcher;
- import flash.events.IEventDispatcher;
- import flash.events.IOErrorEvent;
- import flash.events.SecurityErrorEvent;
- import flash.net.URLLoader;
- import flash.net.URLRequest;
-
- /**
- * @author darren
- * @author tom
- * $Id$
- */
- public class AbstractGoogleMapProvider
- extends AbstractMapProvider
- implements IEventDispatcher
- {
- public static const READY:String = "ready";
-
- // Google often updates its tiles and expires old sets.
- // The version numbers here are recent, but may change.
- protected static var __roadVersion:String = "w2.83";
- protected static var __hybridVersion:String = "w2t.83";
- protected static var __aerialVersion:String = "32";
- protected static var __terrainVersion:String = "app.81";
-
- // An XML file is checked for up-to-date version numbers.
- // Check for updates at http://modestmaps.com for current versions.
- // TODO: make this URL customizable in the constructor
- protected static var __versionSource:String = "google_version.xml";
- protected static var __versionRequested:Boolean = false;
-
- protected var eventDispatcher:EventDispatcher;
-
- public function AbstractGoogleMapProvider(minZoom:int=MIN_ZOOM, maxZoom:int=MAX_ZOOM)
- {
- super(minZoom, maxZoom);
-
- eventDispatcher = new EventDispatcher(this);
-
- if (!__versionRequested) {
- try {
- var loader:URLLoader = new URLLoader(new URLRequest(__versionSource));
- loader.addEventListener(IOErrorEvent.IO_ERROR, onLoadError);
- loader.addEventListener(SecurityErrorEvent.SECURITY_ERROR, onLoadError);
- loader.addEventListener(Event.COMPLETE, onLoadComplete);
- __versionRequested = true;
- }
- catch (error:Error) {
- onLoadError();
- }
- }
- }
-
- // Event Handlers
-
- protected function onLoadComplete(event:Event):void
- {
- // <version road="w2.66" hybrid="w2t.66" aerial="24"/>
- var version:XML = XML((event.target as URLLoader).data);
-
- if(version.@road.toString().length > 0) __roadVersion = version.@road;
- if(version.@hybrid.toString().length > 0) __hybridVersion = version.@hybrid;
- if(version.@aerial.toString().length > 0) __aerialVersion = version.@aerial;
- if(version.@terrain.toString().length > 0) __terrainVersion = version.@terrain;
-
- trace("Modest Maps: "+__versionSource+' loaded (road='+__roadVersion+' hybrid='+__hybridVersion+' aerial='+__aerialVersion+' terrain='+__terrainVersion+')');
-
- dispatchEvent(new Event(AbstractGoogleMapProvider.READY));
- }
-
- protected function onLoadError(event:Event=null):void
- {
- // just use the defaults, I guess.
- trace("Modest Maps: error loading " + __versionSource + ", using defaults from AbstractGoogleMapProvider.as");
- dispatchEvent(new Event(AbstractGoogleMapProvider.READY));
- }
-
- /** delegated to eventDispatcher */
- public function addEventListener(type:String, listener:Function, useCapture:Boolean=false, priority:int=0, useWeakReference:Boolean=false):void
- {
- eventDispatcher.addEventListener(type, listener, useCapture, priority, useWeakReference);
- }
-
- /** delegated to eventDispatcher */
- public function removeEventListener(type:String, listener:Function, useCapture:Boolean=false):void
- {
- eventDispatcher.removeEventListener(type, listener, useCapture);
- }
-
- /** delegated to eventDispatcher */
- public function hasEventListener(type:String):Boolean
- {
- return eventDispatcher.hasEventListener(type);
- }
-
- /** delegated to eventDispatcher */
- public function willTrigger(type:String):Boolean
- {
- return eventDispatcher.willTrigger(type);
- }
-
- /** delegated to eventDispatcher */
- public function dispatchEvent(event:Event):Boolean
- {
- return eventDispatcher.dispatchEvent(event);
- }
-
- }
-}
View
53 lib/com/modestmaps/mapproviders/google/GoogleAerialMapProvider.as
@@ -1,53 +0,0 @@
-package com.modestmaps.mapproviders.google
-{
- import com.modestmaps.core.Coordinate;
- import com.modestmaps.mapproviders.IMapProvider;
- import com.modestmaps.util.BinaryUtil;
-
- /**
- * @author darren
- * $Id$
- */
- public class GoogleAerialMapProvider
- extends AbstractGoogleMapProvider
- implements IMapProvider
- {
- public function GoogleAerialMapProvider(minZoom:int=MIN_ZOOM, maxZoom:int=MAX_ZOOM)
- {
- super(minZoom, maxZoom);
- }
-
- public function toString():String
- {
- return "GOOGLE_AERIAL";
- }
-
- public function getTileUrls(coord:Coordinate):Array
- {
- // TODO: http://khm1.google.com/kh?v=32&hl=en&x=10513&s=&y=25304&z=16&s=Gal
- return [ "http://kh" + Math.floor(Math.random() * 4) + ".google.com/kh?n=404&v=" + __aerialVersion + "&t=" + getZoomString(sourceCoordinate(coord)) ];
- }
-
- protected function getZoomString(coord:Coordinate):String
- {
- var gCoord:Coordinate = new Coordinate((Math.pow(2, coord.zoom) - coord.row - 1),
- coord.column, coord.zoom + 1);
-
- // convert row + col to zoom string
- var rowBinaryString:String = BinaryUtil.convertToBinary(gCoord.row);
- rowBinaryString = rowBinaryString.substring(rowBinaryString.length - gCoord.zoom);
-
- var colBinaryString:String = BinaryUtil.convertToBinary(gCoord.column);
- colBinaryString = colBinaryString.substring(colBinaryString.length - gCoord.zoom);
-
- // generate zoom string by combining strings
- var urlChars:String = 'tsqr';
- var zoomString:String = "";
-
- for(var i:Number = 0; i < gCoord.zoom; i += 1)
- zoomString += urlChars.charAt(BinaryUtil.convertToDecimal(rowBinaryString.charAt(i) + colBinaryString.charAt(i)));
-
- return zoomString;
- }
- }
-}
View
32 lib/com/modestmaps/mapproviders/google/GoogleHybridMapProvider.as
@@ -1,32 +0,0 @@
-package com.modestmaps.mapproviders.google
-{
- import com.modestmaps.core.Coordinate;
- import com.modestmaps.mapproviders.IMapProvider;
-
- /**
- * @author darren
- * $Id$
- */
- public class GoogleHybridMapProvider
- extends GoogleAerialMapProvider
- {
- public function GoogleHybridMapProvider(minZoom:int=MIN_ZOOM, maxZoom:int=MAX_ZOOM)
- {
- super(minZoom, maxZoom);
- }
-
- override public function toString():String
- {
- return "GOOGLE_HYBRID";
- }
-
- override public function getTileUrls(coord:Coordinate):Array
- {
- var sourceCoord:Coordinate = sourceCoordinate(coord);
- var zoomString:String = "&x=" + sourceCoord.column + "&y=" + sourceCoord.row + "&zoom=" + (17 - sourceCoord.zoom);
- var url:String = "http://mt" + Math.floor(Math.random() * 4) + ".google.com/mt?n=404&v=" + __hybridVersion + zoomString;
- return super.getTileUrls(coord).concat(url);
- }
-
- }
-}
View
35 lib/com/modestmaps/mapproviders/google/GoogleRoadMapProvider.as
@@ -1,35 +0,0 @@
-package com.modestmaps.mapproviders.google
-{
- import com.modestmaps.core.Coordinate;
- import com.modestmaps.mapproviders.IMapProvider;
-
- /**
- * @author darren
- * $Id$
- */
- public class GoogleRoadMapProvider
- extends AbstractGoogleMapProvider
- implements IMapProvider
- {
- public function GoogleRoadMapProvider(minZoom:int=MIN_ZOOM, maxZoom:int=MAX_ZOOM)
- {
- super(minZoom, maxZoom);
- }
-
- public function toString():String
- {
- return "GOOGLE_ROAD";
- }
-
- public function getTileUrls(coord:Coordinate):Array
- {
- // TODO: http://mt1.google.com/mt?v=w2.83&hl=en&x=10513&s=&y=25304&z=16&s=Gal
- return [ "http://mt" + Math.floor(Math.random() * 4) + ".google.com/mt?n=404&v=" + __roadVersion + getZoomString(sourceCoordinate(coord)) ];
- }
-
- protected function getZoomString(coord:Coordinate):String
- {
- return "&x=" + coord.column + "&y=" + coord.row + "&zoom=" + (17 - coord.zoom);
- }
- }
-}
View
1 lib/com/modestmaps/mapproviders/google/GoogleTerrainMapProvider.as
@@ -1 +0,0 @@
-package com.modestmaps.mapproviders.google
View
2 lib/google_version.xml
@@ -1,2 +0,0 @@
-<?xml version="1.0"?>
-<version road="w2.83" hybrid="w2t.83" aerial="32" terrain="app.81" />
View
2 samples/air/src/ModestMapAir.mxml
@@ -13,7 +13,7 @@
/* ENUMS */
- [Bindable] private var mapTileProviders:Array = ["GOOGLE_ROAD","GOOGLE_AERIAL","GOOGLE_HYBRID","MICROSOFT_AERIAL","MICROSOFT_ROAD","MICROSOFT_HYBRID","YAHOO_ROAD","YAHOO_AERIAL","YAHOO_HYBRID","ZOOMIFY","OPEN_STREET_MAP","BLUE_MARBLE",];
+ [Bindable] private var mapTileProviders:Array = ["MICROSOFT_AERIAL","MICROSOFT_ROAD","MICROSOFT_HYBRID","YAHOO_ROAD","YAHOO_AERIAL","YAHOO_HYBRID","ZOOMIFY","OPEN_STREET_MAP","BLUE_MARBLE",];
/* Local Reference */
private var mouseWheelTimer:Timer = new Timer(150,1);
View
6 samples/as3/ModestMapsSample/ModestMapsSample.as
@@ -1,6 +1,6 @@
-package {
- import com.adobe.viewsource.ViewSource;
- import com.modestmaps.Map;
+package {
+ import com.adobe.viewsource.ViewSource;
+ import com.modestmaps.Map;
import com.modestmaps.TweenMap;
import com.modestmaps.core.MapExtent;
import com.modestmaps.events.MapEvent;
View
2 samples/as3/ModestMapsSample/google_version.xml
@@ -1,2 +0,0 @@
-<?xml version="1.0"?>
-<version road="w2.83" hybrid="w2t.83" aerial="32"/>
View
2 samples/flash/ModestMapsSample.as
@@ -1 +1 @@
-package {
+package {
View
2 samples/flash/google_version.xml
@@ -1,2 +0,0 @@
-<?xml version="1.0"?>
-<version road="w2.83" hybrid="w2t.83" aerial="32"/>
View
2 samples/flex/SampleFlexClient/google_version.xml
@@ -1,2 +0,0 @@
-<?xml version="1.0"?>
-<version road="w2.83" hybrid="w2t.83" aerial="32"/>

0 comments on commit a892c4d

Please sign in to comment.
Something went wrong with that request. Please try again.