erikabruni73 / osmdroid

Automatically exported from code.google.com/p/osmdroid
0 stars 0 forks source link

Add support for Bing Maps #236

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
See comment 7 of issue 12.

Original issue reported on code.google.com by neilboyd on 5 Jul 2011 at 11:33

GoogleCodeExporter commented 9 years ago
Get a Bing Maps API Key here:
http://msdn.microsoft.com/en-us/library/ff428642.aspx

Original comment by neilboyd on 5 Jul 2011 at 3:32

GoogleCodeExporter commented 9 years ago
I've tidied up the first patch a bit and incorporated it into the sample. Still 
needs more work, but this is an initial working version. Looks promising!

Original comment by neilboyd on 5 Jul 2011 at 3:44

Attachments:

GoogleCodeExporter commented 9 years ago
It's probably a good idea to put this in a separate project (within osmdroid).  
Perhaps we should also move the other third-party tile providers and overlays 
into it. So something like osmdroid-third-party project.  This is mainly for 
licensing reasons, and also because the primary purpose of osmdroid is 
displaying osm maps.

Original comment by neilboyd on 6 Jul 2011 at 7:11

GoogleCodeExporter commented 9 years ago
I've updated the patch to get the API key from the manifest

Original comment by neilboyd on 6 Jul 2011 at 10:53

Attachments:

GoogleCodeExporter commented 9 years ago
Attached is another patch with the following changes compared to patch2:
 - implemented the resources properly
 - extended QuadTreeTileSource instead of OnlineTileSourceBase
 - moved a few methods around

I'd like to commit this, but I'm not sure how to do it. I suspect it violates 
our/Bing license if I just commit it as is.

Original comment by neilboyd on 8 Jul 2011 at 2:23

GoogleCodeExporter commented 9 years ago
It helps if I attach the patch!

Original comment by neilboyd on 8 Jul 2011 at 2:32

Attachments:

GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
I started creating a new project osmdroid-third-party and moved the Bing stuff 
to there. See patch4.

Original comment by neilboyd on 11 Jul 2011 at 5:53

Attachments:

GoogleCodeExporter commented 9 years ago
I committed this in revision 948.

Original comment by neilboyd on 11 Jul 2011 at 11:34

GoogleCodeExporter commented 9 years ago
See this link for a description of the Bing API:
http://msdn.microsoft.com/en-us/library/ff701721.aspx

Original comment by neilboyd on 11 Jul 2011 at 2:12

GoogleCodeExporter commented 9 years ago
It would be handy if there was some kind of lazy loading of the meta data so 
that it is only read when it is first needed. Currently it's implemented as a 
static method that needs to be called before the class is instantiated, which 
means you always need to get the meta data even if you don't use the tiles.

Original comment by neilboyd on 11 Jul 2011 at 2:26

GoogleCodeExporter commented 9 years ago
Perhaps it would be better to implement IStyledTileSource<String> instead of 
IStyledTileSource<Integer>, where the String is one of the constants "Aerial", 
"AerialWithLabels", "Road".

And then only store one set of meta data, which is retrieved when you first 
need it.

We can then have a simpler static method to get the API key from the manifest, 
similar to CloudMade.

Original comment by neilboyd on 11 Jul 2011 at 2:56

GoogleCodeExporter commented 9 years ago
The use of IStyledTileSource<Integer> instead of IStyledTileSource<String> was 
for performance purpose (I don't know how the getStyle method is used but if 
there are comparisons for example, the Integer is better than String). The 
access of associated string is a direct access in an array in getStyleName 
method.

Good idea to add it in a third party project, it will enable to extends 
functionnalities without changing the core of the SDK.

Original comment by caerw...@gmail.com on 12 Jul 2011 at 12:02

GoogleCodeExporter commented 9 years ago
Get/set style is not called frequently - it's just a setup thing.

I intend to do what I described above, ie change to a string which is simply 
one of those constants, and then load the meta data the first time it's needed. 
This will allow me to put the Bing provider back into the default app.

I'll probably also create an issue to do Google Maps in the third party 
package.  People keep asking for this and we've been rejecting it, but there's 
no reason not to do it now.

Original comment by neilboyd on 12 Jul 2011 at 1:08

GoogleCodeExporter commented 9 years ago
I think this is working fine now

Original comment by neilboyd on 15 Jul 2011 at 5:11

GoogleCodeExporter commented 9 years ago
Is there anywhere an example, on how to use this in the current release 
version? (3.0.5)

Original comment by h...@flashlight.de on 9 Aug 2011 at 11:37

GoogleCodeExporter commented 9 years ago
It's in the code. Have a look at MapActivity.

Original comment by neilboyd on 9 Aug 2011 at 12:03