positioning markers given a location in the map image (1:1)
I would like to show markers whose location I know as an absolute coordinate in pixels in the underlying map image (zoom 1:1) and not as a LatLng.
I tried tweaking the MarkerClip class but to no avail (I couldn't follow the multiple conversions from image point to Coordinate, etc.. ).
What's the best-practice to achieve this?
I tried tweaking the MarkerClip class but to no avail (I couldn't follow the multiple conversions from image point to Coordinate, etc.. ).
What's the best-practice to achieve this?
1
person has this question
I have this question, too!
Tell me when someone answers.
The more people who ask this question, the more it gets noticed.
The more people who ask this question, the more it gets noticed.
Create a customer community for your own organization
Plans starting at $19/month
-
Inappropriate?Is this the same question as http://getsatisfaction.com/modestmaps... ? There's no need to start another thread just because you didn't get the right answer first time.
As a quick hack you can make a provider that will pretend that latitude is y pixels and longitude is x pixels. Use a LinearProjection so that no distortion is introduced. That should work. -
Inappropriate?Actually this is the opposite question from the thread you mention.
What I am trying to do is to define a marker that has a pixel-coordinate location instead of LatLong. If I'm not mistaken, the way to track panning and zooming is to use a markerclip.
So, I need a way to map absolute pixel coordinates to screen coordinates.
Any ideas?
many thanks
I’m frustrated
-
Inappropriate?There are a few ways to do this. My suggestion above is the quickest - use the calculator to define a transform where you pretend that latitude is y-pixels and longitude is x-pixels and use a LinearProjection. There might be a few places where this is awkward and annoying to code, but there's no real reason it wouldn't work reliably apart from that.
Another option is to make a copy of Map.as or TweenMap.as and adapt it to use Points instead of Locations. For the most part, TileGrid doesn't know about geography (only Coordinates) and Map handles the conversion from geographical Location (lat/lon) to Coordinates (row/col/zoom). So you could make PixelMap or something that does a translation from image pixels to row/col/zoom... does that make sense?
I'd try a dummy projection that treats lat/lon as pixels first though. That's something like what we ended up doing for http://sfmoma.org/artscope and http://calacademy.org/map
Loading Profile...



EMPLOYEE