You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I've forked the project and added a method called LatLonPoint.toPixels
It returns the top and left pixel coordinates for the point according to map containing DOM element. It is for microsoft7 provider. I'm not aware if other providers can be made to calculate the same thing?
So I'm opening this discussion - is it possible to have an implementation of this method in Mapstraction for other providers?
So I'm opening this discussion - is it possible to have an implementation of this method in Mapstraction for other providers?
The short answer is ... it depends. We'd need to check that there's either a one to one correlation between the (new) Mapstraction API call and one in each of the supported providers, or that this is capable of being calculated if there isn't a direct correllation.
So in order to add this as a supported call in Mapstraction, we can't implement it solely for a single provider, in this case Microsoft/Bing v7. This would be contrary to the whole point of Mapstraction. It would need to be implemented across all providers. Or, at the bare minimum, implemented in a critical mass of providers, though this isn't ideal.
Is this something you would consider helping with via your fork of the project?
You are describing exactly what my intend was. I'm going to work on my fork to support more and more providers. And hopefully this will be merged at some point when ready.
Thank you for the information on HERE maps. I recently found that Bing has similar feature, which I missed - map.tryLocationToPixel() - so I'll update my code for Bing v7 using the API.
That's great and really good to hear. Two quick points ... firstly make sure your fork is using the release-3.0 branch so you pick up the latest code. Secondly, when you come to expose the new API call through the Mapstraction core, feel free to get in touch if you need any help as this isn't documented. In fact, keep in touch and feel free to ask for as much or as little help as you need.
Activity
vicchi commentedon Aug 6, 2013
Thanks for writing this; this is all good.
So I'm opening this discussion - is it possible to have an implementation of this method in Mapstraction for other providers?
The short answer is ... it depends. We'd need to check that there's either a one to one correlation between the (new) Mapstraction API call and one in each of the supported providers, or that this is capable of being calculated if there isn't a direct correllation.
For example, the HERE maps API has a
nokia.map.Display.geoToPixel()API call which could be used, whereas there's no equivalent in Google's v3 API though this can be determined with some code (see http://krasimirtsonev.com/blog/article/google-maps-api-v3-convert-latlng-object-to-actual-pixels-point-object).So in order to add this as a supported call in Mapstraction, we can't implement it solely for a single provider, in this case Microsoft/Bing v7. This would be contrary to the whole point of Mapstraction. It would need to be implemented across all providers. Or, at the bare minimum, implemented in a critical mass of providers, though this isn't ideal.
Is this something you would consider helping with via your fork of the project?
evgeni-spasov commentedon Aug 7, 2013
You are describing exactly what my intend was. I'm going to work on my fork to support more and more providers. And hopefully this will be merged at some point when ready.
Thank you for the information on HERE maps. I recently found that Bing has similar feature, which I missed - map.tryLocationToPixel() - so I'll update my code for Bing v7 using the API.
vicchi commentedon Aug 7, 2013
That's great and really good to hear. Two quick points ... firstly make sure your fork is using the
release-3.0branch so you pick up the latest code. Secondly, when you come to expose the new API call through the Mapstraction core, feel free to get in touch if you need any help as this isn't documented. In fact, keep in touch and feel free to ask for as much or as little help as you need.