Thanks for your response Actually I have coordinates of all states of India and I create GML files from these coordinates. These coordinates are in 4326.Then I convert these gml files into shape files after that I register these shape files into geoserver.Now I am setting these layers as a tiles on to map using getmap request. My demo is working fine for more than 4 zoom level but on lower zoom level all tiles appear as streched image not on correct position.I dont know how to solve this problem.Please help me.I want to display different states in different color Is there any other way to do so?
On Jul 9, 3:54 pm, Nianwei <[email protected]> wrote: > You are not supposed to use 4326 to overlay maps with Google tiles. > Some versions of geoserver support so called 900913 and you should do > a simple sphere mercator transformation on client side (search either > this forum or the JS forum to find code to do that) to convert latlng > to mercator then send off toWMS. Some server products allow input SR > different than output SR butWMSdoes not require it. > > On Jul 7, 6:23 am, CS <[email protected]> wrote: > > > Hi > > > I am using geoserver1.7.4 and I registered all layers using 4326 srs. > > I am setting tiles on google map using getmap request . > > code is as follows: > > > import com.google.maps.Copyright; > > import com.google.maps.CopyrightCollection; > > import com.google.maps.LatLng; > > import com.google.maps.LatLngBounds; > > import com.google.maps.TileLayerBase; > > > import flash.display.DisplayObject; > > import flash.display.Loader; > > import flash.events.IOErrorEvent; > > import flash.geom.Point; > > import flash.net.URLRequest; > > > import mx.controls.Alert; > > > public class CampusTileLayer extends TileLayerBase { > > private var tileSize:Number; > > private var opac:Number=1.0; > > public var Layer:String; > > //private var offset:Number=16777216; > > private var offset:Number=16777216; > > private var radius:Number=offset / Math.PI; > > private var op:Number=1; > > > public function test(opacity:Number):void > > { > > opac = opacity; > > } > > > public function CampusTileLayer > > (tileSize:Number,Layer:String,op:Number) { > > try > > { > > this.op=op; > > var copyrightCollection:CopyrightCollection = new > > CopyrightCollection(); > > super(copyrightCollection, 14, 20,op); > > this.tileSize = tileSize; > > this.Layer=Layer; > > > // Add a custom copyright that will apply to the entire map > > layer. > > copyrightCollection.addCopyright( > > new Copyright("CustomCopyright", > > new LatLngBounds(new LatLng(-180, 90), > > new LatLng(180, -90)), > > 0, > > "CustomTileProvider")); > > } > > catch(ex:Error) > > { > > Alert.show("Error in CampusTileLayer"); > > } > > } > > > public override function loadTile(tilePos:Point, > > zoom:Number):DisplayObject { > > var zoomorg=zoom; > > zoom = 17 - zoom; > > //LowerLeft Corner > > > var tileIndexLL:Point = new Point(256*tilePos.x, > > 256*(tilePos.y > > +1)); > > //UpperRight Corner > > var tileIndexUR:Point = new > > Point(256*(tilePos.x+1), 256* > > (tilePos.y)); > > var bbox:String; > > bbox=XToL(zoom,tileIndexLL.x)+ ","+YToL > > (zoom,tileIndexLL.y)+","+XToL(zoom,tileIndexUR.x)+","+YToL > > (zoom,tileIndexUR.y); > > > var testLoader:Loader = new Loader(); > > var url:String="http://localhost:8081/geoserver/wms? > > SERVICE=WMS&VERSION=1.1.1&REQUEST=GetMap&LAYERS="+Layer > > +"&STYLES=&TRANSPARENT=true&SRS=EPSG:4326&FORMAT=image/ > > png&WIDTH=256&HEIGHT=256&BBOX="+bbox; > > > try > > { > > var urlRequest:URLRequest = new URLRequest(url); > > testLoader.contentLoaderInfo.addEventListener > > (IOErrorEvent.IO_ERROR, ioErrorHandler); > > testLoader.load(urlRequest); > > } > > catch (error:Error){} > > return testLoader; > > } > > > private function ioErrorHandler(e:IOErrorEvent):void > > {} > > > public function LToX(z:Number,x:Number):Number { > > return (offset+radius*x*Math.PI/180)>>z; > > } > > > public function LToY(z:Number,y:Number):Number { > > return > > (offset-radius*Math.log((1+Math.sin(y*Math.PI/180))/(1- > > Math.sin(y*Math.PI/180)))/2)>>z; > > } > > > public function XToL(z:Number,x:Number):Number { > > return (((x<<z)-offset)/radius)*180/Math.PI; > > } > > > public function YToL(z:Number,y:Number):Number { > > return > > (Math.PI/2-2*Math.atan(Math.exp(((y<<z)-offset)/radius))) > > *180/Math.PI; > > } > > > } > > > Now deviation of tiles at lower zoom level is a big problem for me as > > I have to show tiles at every zoom level. --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
