I'm not sure if this is the right place to post this kind of thing, but I noticed when testing out Desktop 5.0.151 GoogleMapsOverlay objects cannot be created, there is a null object exception error. At least I recieved one when trying to create the object. I switched back to 5.0.129 and GoogleMapsOverlay worked again.
5.0.151 error
Hello Gary,
Yes, we have changed some code in GoogleMapsOverlay 2 weeks ago, and made a newest change today earlier, could you please download the newest version(5.0.160.0) tomorrow and have another try?
If you still meet this problem, could you please provide some code?
Regards,
Gary
Hi, so the latest version is fine. I do however have one more question. GoogleMaps and OpenStreetMaps are in units Meters while WorldMapKit is in Degree Decimals. I would like to make all three maps interchangeable and available to the user. I know you can change the projection on a given layer to work with meter unit maps. Does this projection change work with every kind of layer you have? i.e. (inmemoryfeaturelayer, simplemarkerlayer…) Would I have to change the projection of every layer every time I switch between meter to decimaldegree maps or is there a way to change the googlemapoverlay itself.
Hello Gary,
I'm glad it's working now.
And sorry to say, we can't let the googlemap use decimals degree, so that if you want to use thinkgeo map work with googlemap together, you have to change the projection of thinkgeo map.
The FeatureSource.Projection if a property of BaseClass FeatureLayer, so projection work with every kind of layer we have.
And if you need to switch the map unit between meter and decimal degress, you truly need some logic code to control the projection change everytime.
Regards,
Gary
Alright, that’s not a huge problem. FeatureSource.Projection is a property of BaseClass FeatureLayer. What about SimpleMarkerOverlay? I can’t seem to find the projection property in that.
Also, I’d like to be able to create default styles for markers. Currently I can only find the Image property which only accepts an image. I would like to be able to set some default styles such as a simple blue circle with a black outline to markers. Another solution would be to use an inmemoryfeature layer and pointshapes but be able to edit the default style of each individual pointshape.
Hello Gary,
SimpleMarkerOverlay is an Overlay not a FeatureLayer, so it didn't including projection property.
If you want to use it work with GoogleMap, you need transform the pointshape location before you add it into marker.
Please look at this post, Val's code can show you some idea, though he didn't use the SimpleMarkerOverlay, but the principle is the same, also you can try his code as another way.
gis.thinkgeo.com/Support/Discussion...fault.aspx
And this post can show you how to define a custom marker to fit your situation.
gis.thinkgeo.com/Support/Discussion...fault.aspx
Just let me know if you meet problems.
Regards,
Gary
Gary,
I would like to add a comment to your post of 10-24-2011 08:58 AM. It is actually possible to get GoogleMap to decimal degrees. Look at the sample Google Map to Geodetic wiki.thinkgeo.com/wiki/Map_Suite_De...o_Geodetic
Keep in mind that this is a trick to get your Google Map to display in decimal degrees and it has a lot of limitations as you can read in the description of the sample. But I thought you might want to be interested in this. Thank you.
I’ve decided to stick with inmemoryfeature layers, since they it seems like the only way to work with googlemaps and longitude/latitude coordinates is to change the projection of the layer like in the first link Gary provided. Thanks for the post Val but I don’t think that will work for my project. Although the limitation to inmemoryfeature lays is that it seems all features in the layer are set to the same style. Is there a way to have multiple features on a layer with different styles?
Hello Gary,
If you want to draw different style of features for your InMemoryLayer you can use either the ValueStyle, ClassBreakStyle or RegExStyle. Each of these will allow you to draw a different style for each features based upon a column value in your InMemoryLayer.
ValueStyle : This class allows you to match a value with data in the feature to determine how to draw that feature.
ClassBreakStyle : This class represents a style based on class break values(A range of values).
RegExStyle : This class allows you to draw features differently based on regular expression matching.
We have samples for them, they are DrawAFeatureBasedOnAValue, DrawThematicFeatures and DrawFeaturesBasedRegularExpression.
Regards,
Gary
Thanks! That’s exactly what I needed and it works perfectly. One thing I noticed though is that my ellipses get elongated as they move north and south. I want them to be perfect circles, but depending on where I put them on the map they look funny. The Height and Width stay the same but if I put the center of the circle northern of southern it looks oval.
Gary,
About the circle looking oval with a map in decimal degrees, there is a previous post where I go in length about the explanation and to approach the problem. The post is "GetArea on Buffered shape not working as expected" gis.thinkgeo.com/Support/Discussion...fault.aspx
I particularly recommend that you read the post I wrote on 11-10-2009 10:49 AM. You will find the concrete solution on how to approach this issue.
So, for example, if you want to draw a circle at the location -80 of longitude and 45 of latitude, use the following code:
//Fist we get the equivalent in decimal degrees for a distance of 1 km at longitude 80 West
double latDiff = DecimalDegreesHelper.GetLatitudeDifferenceFromDistance(1, DistanceUnit.Kilometer, -80);
//Second, we build the circle using decimal degrees
EllipseShape myCircle = new EllipseShape(new PointShape(-80, 45), latDiff);