Hey Mohed, Yes it is, you need to extend TileLayer and override the loadTile function. Then instantiate a new TileLayerOverlay with your new class.
Jonathan ScribbleMaps.com On Aug 11, 4:57 pm, Mohed <[email protected]> wrote: > Hi, > is it possible to add layers from open street map to google flash api > like in javascript ? > > can anyone provide a sample in flex? couldnt find anything using > google searches. > > here is the javascript api code that do this action: > > <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" > "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> > <html xmlns="http://www.w3.org/1999/xhtml"> > <head> > <title>OpenStreetMap</title> > <meta http-equiv="content-type" content="text/html; charset=utf-8"/> > > <script src="http://maps.google.com/maps? > file=api&v=2&key=YOUR_KEY_HERE" type="text/javascript"></ > script> > <script type="text/javascript"> > //<![CDATA[ > > function load() > { > if (!GBrowserIsCompatible()) > return; > > var copyOSM = new GCopyrightCollection("<a > href=\"http://www.openstreetmap.org/\">OpenStreetMap</a>"); > copyOSM.addCopyright(new GCopyright(1, new GLatLngBounds(new > GLatLng(-90,-180), new GLatLng(90,180)), 0, " ")); > > var tilesMapnik = new GTileLayer(copyOSM, 1, 17, > {tileUrlTemplate: 'http://tile.openstreetmap.org/{Z}/{X}/{Y}.png'}); > var tilesOsmarender = new GTileLayer(copyOSM, 1, 17, > {tileUrlTemplate: 'http://tah.openstreetmap.org/Tiles/tile/{Z}/{X}/ > {Y}.png'}); > > var mapMapnik = new GMapType([tilesMapnik], > G_NORMAL_MAP.getProjection(), "Mapnik"); > var mapOsmarender = new GMapType([tilesOsmarender], > G_NORMAL_MAP.getProjection(), "Osmarend"); > var map = new GMap2(document.getElementById("map"), > { mapTypes: [mapMapnik, mapOsmarender] }); > > map.addControl(new GLargeMapControl()); > map.addControl(new GMapTypeControl()); > map.setCenter( new GLatLng(55.95, -3.19), 13); > } > > //]]> > </script> > </head> > <body onload="load()" onunload="GUnload()"> > > <div id="map" style="width: 600px; height: 600px; border:1px solid > gray;"></div> > > </body> > </html> -- You received this message because you are subscribed to the Google Groups "Google Maps API For Flash" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/google-maps-api-for-flash?hl=en.
