hi first of all i wants to thanks all of you thinkgeo guys you all are really helpful.
and now i have problem, problem is my marker is showing exact correct location in staticoverlay thinkgeo map but if i select google map from baseoverlays my location marker is display in wrong location because i think my google map reverse my latitude and longidute it make longitude as latitude and latitude become longitude.
how to correct this error.
my exact location is afghanistan in thinkgeo map staticoverlay when i select google map my marker display in wrong location and my code is
GoogleOverlay google = new GoogleOverlay("Google Map");
google.JavaScriptLibraryUri = new Uri(@"maps.googleapis.com/maps/api/js?sensor=false");
google.GoogleMapType = GoogleMapType.Normal;
and layers add in like
Map1.StaticOverlay.Layers.Add(worldLayer);
Map1.StaticOverlay.Layers.Add(capitalLayer);
Map1.StaticOverlay.Layers.Add(capitalLabelLayer);
Map1.StaticOverlay.Layers.Add(provinceShapefile);
Map1.StaticOverlay.Layers.Add(districtShapeFileFeatureLayer);
Map1.CustomOverlays.Add(google);
Map1.StaticOverlay.Layers.Add(myData);
if(cblLayers.Text=="River")
Map1.StaticOverlay.Layers.Add(River);
Map1.CurrentExtent = new RectangleShape(5, 78, 30, 26);
Map1.MapTools.OverlaySwitcher.Enabled = true;
Map1.MapTools.MouseCoordinate.Enabled = true;
Thinkgeo marker display wrong on google map
Hi Raja,
The map unit for GoogleMap is Meter, it looks your current extent is based on DecimalDegree.
Please set map1.MapUite equal meter first, then use ManageProj4 to convert your point from DecimalDegree to Meter.
ManagedProj4Projection proj4 = new ManagedProj4Projection();
proj4.InternalProjectionParametersString = ManagedProj4Projection.GetDecimalDegreesParametersString();
proj4.ExternalProjectionParametersString = ManagedProj4Projection.GetGoogleMapParametersString();
PointShape yourPoint = new PointShape();
PointShape yourPointUnderGoogleProjection = proj4.ConvertToExternalProjection(yourPoint) as PointShape;
Regards,
Don
i tried it but it is not working actually data is coming from database
i also change map1 into meter
Map1.MapUnit = GeographyUnit.Meter;
InMemoryFeatureLayer myData = ReportsForDEOAndQcTest();
ManagedProj4Projection proj4 = new ManagedProj4Projection();
proj4.InternalProjectionParametersString = ManagedProj4Projection.GetDecimalDegreesParametersString();
proj4.ExternalProjectionParametersString = ManagedProj4Projection.GetGoogleMapParametersString();
PointShape yourPoint = new PointShape();
proj4.Open();
PointShape yourPointUnderGoogleProjection = proj4.ConvertToExternalProjection(yourPoint) as PointShape;
Map1.StaticOverlay.Layers.Add(worldLayer);
Map1.StaticOverlay.Layers.Add(capitalLayer);
Map1.StaticOverlay.Layers.Add(capitalLabelLayer);
Map1.StaticOverlay.Layers.Add(provinceShapefile);
Map1.StaticOverlay.Layers.Add(districtShapeFileFeatureLayer);
Map1.StaticOverlay.Layers.Add(myData);
Map1.CustomOverlays.Add(google);
if(cblLayers.Text=="River")
Map1.StaticOverlay.Layers.Add(River);
Map1.CurrentExtent = new RectangleShape(5, 78, 30, 26);
Map1.MapTools.OverlaySwitcher.Enabled = true;
Map1.MapTools.MouseCoordinate.Enabled = true;
please give me a specific example according to my code thanks.
Hi Raja,
The sample code I provided is tell you how to use Proj4 to convert your data, because you said your marker don’t shows when you choose GoogleMap.
You need to reproject all of your coordinates, including marker, extent, your shape files under projection epsg 4326.
Please view our “Use A Different Projection For A FeatureLayer” sample under our HowDoISamples, that shows how to reprojection your layer.
Regards,
Don
hi don marker is display but display at different location because google map convert latitude as longitude and longitude as latitude thats why its display wrong marker on wrong location thanks.
Hi Raja,
I think we don’t have the issue you mentioned for Google map, longitude meant x and latitude meant y, we display that correct before.
Could you please provide some information as below:
1. Your marker location under projection 4326 (decimal degree)
2. Your marker location under projection 900913 (meter)
3. A screen shot shows your marker on map for 4326
4. A screen shot shows your marker on google map(900913)
I can do some research about that and see what’s the problem here.
Regards,
Don