This is a known issue for Projection; One way to go around this is pre-project the data instead of projecting it on the fly.
Following code shows the way, hope it helps: Proj4Projection proj4 = new Proj4Projection(); proj4.InternalProjectionParametersString = Proj4Projection.GetEpsgParametersString(4326); proj4.ExternalProjectionParametersString = Proj4Projection.GetGoogleMapParametersString();
We want to use the index file we created for the shape file for speed. The issue is that the index uses bounding boxe rectangle and when you project them they tend to twist and mangle. If you just get the bounding box of the mangles box then it is not correct and at higher extents it is very obvious. It is a difficult problem with no known solution as of yet except to re-project the data or to use the data without an index which is slow. It all really depends on the projects etc, for UTM and State plane which are used very often at lower extents it is not a big deal because the twisting is very minor bad but in other projections it gets radical. It is something we are still putting some brainpower on but have yet to come up with something turnkey for the users.
When adding InMemoryLayers at runtime, and then changeing extent or pan, sometimes the InMemolayers are not drawed. Setting the layer IsVisible to false and the true again draws the layer, but this gives the map 3 refresh… performence :(
All my layer are projectet to meters, so that i can use the google overlay, i don’t want all my layer to be stored as files.
Hi The problem is not to set invisible, but that the InMemory layers not always are drawed correct (missing bitmap etc.) The 3 refresh, first when the layer is populated, second to turn layer off, third layer on
If you zoom the the map draws the layers correct "must" of the times.
Could you provide us some sample codes to recreate your problem? Basically, is it possible by changing some codes (for example, change the InmemoryLayer) in the attachment sample above to show your problem?
Please feel free let me know if any more questions!
BeginInvoke(new EventHandler<vdcwindfarmitemeventargs></vdcwindfarmitemeventargs>(m_vdcService_GetWindFarmItemsCompleted), new object[] { sender, e });
One dumb question is in the OnLoad for the form do you set the Map.MapUnit = Meters? The default for the map is decimal degrees and there are a number of math function where it counts. This might cause the scale calculation to be incorrect. Can you try this and let me know the results.
The other thing I would try is to not pass in the google projection to the layer and when you add the windmills in your method create a google maps projection class and project the points themselves and add them into the in memory layer already projected. I bet that does the trick.
My map is in meters :) I have tried to insted of setting the googleProjection on the feature layer, to convert my points to meters when adding, this make a huge difference, now i works.
When setting the projection on an layer, i will still aspect it to do the conversion for me, please correct me if i’m wrong.
I am glad to see that working for you. I intended it only to get you up and running. It is actually more effecient this way as you don’t need to re-project the points over and over as you draw. I bet the issues has to do with the extent being re-projected on the fly to figure out of the in memory feature set is in the right area. Could you do me a favor and send in some of the points you are using and I will try and re-create the issues here. This could really help us find out what the real problem is. I already know the projection etc so I just need your points. You can send them to support@thinkgeo.com and hhave them send it to David and Yale please.