<div style='position:absolute;left:0;top:0;'>
Here is some text, blablabla. It is a long paragraph.
</div>
<img src='http://platinumpaintandbody.homestead.com/gradient_background.jpg' style='position:absolute;left:0;top:0;opacity:0.4;pointer-events:none;
'/>
Can I place this code (translated into v4a) or code like this into a button and retrieve on button_click?
var center = map.getCenter();
var wrapped = new google.maps.LatLng(center.lat(), center.lng());
function initialize() {
var mapDiv = document.getElementById('map_canvas');
var myOptions = {
zoom: 12,
center: chicago,
mapTypeId: google.maps.MapTypeId.ROADMAP
}
map = new google.maps.Map(mapDiv, myOptions);
var marker=new google.maps.Marker({position:myOptions.center, map:map});
google.maps.event.addListener(map, 'center_changed', function(){
marker.setPosition(map.getCenter());
});
// Create the DIV to hold the control and
// call the HomeControl() constructor passing
// in this DIV.
var homeControlDiv = document.createElement('div');
var homeControl = new HomeControl(homeControlDiv, map, chicago);
homeControlDiv.index = 1;
map.controls[google.maps.ControlPosition.TOP_RIGHT].push(homeControlDiv);
}
Dim WebViewExtras1 As WebViewExtras
WebViewExtras1.addJavascriptInterface(MyWebView, "B4A")
Sub ProcessMapCenter(MapCenter As String)
' MapCenter will be a String formatted latitude,longitude
' (comma separated values)
End Sub
B4A.CallSub('ProcessMapCenter', map.getCenter().toUrlValue())
Dim Javascript As String
Javascript="B4A.CallSub('ProcessMapCenter', map.getCenter().toUrlValue())"
WebViewExtras1.executeJavascript(MyWebView, Javascript)
OSMDroid also has an add-on class that does much the same with Google's tiles: /trunk/osmdroid-third-party/src/main/java/org/osmdroid/google/overlay/ - osmdroid - OpenStreetMap-Tools for Android - Google Project Hosting.
I think whether or not you still want to use these tile sources is entirely up to you.
If you create an app for your own personal use and add these tile sources you will probably find there is no problem - the number of tiles your app downloads is unlikely to raise the attention of the tile source provider.
BUT if you publish an app with one or more of these tile sources and that app becomes popular then there is a good chance that the tile downloads will attract the attention of the tile source provider who will then come looking for you...
Hi again Barry.
I just started to look at how the Google Maps tiles could be added to OSMDroid - obviously that's without any permission to use those tiles as already explained.
I thought i'd just take a look...
I loaded a Google Maps API map and found the URL to a tile, i copy and pasted that into a new browser window and as expected the tile appeared.
I changed the zoom level in that tile request and got the new requested tile.
I changed the zoom level again and instead of getting the new requested tile got an error message Your client has issued a malformed or illegal request. That’s all we know.!!
Google are actively blocking access to their map tiles from outside of the Google Maps API.
I think when you load a web based Google Map, the Google Maps API does something similar to starting an anthenticated or authorised session.
The web based map gets access to the tiles as the Google tile servers know that the tiles are being requested by a Google map.
Trying to access the tiles from outside of the Google Maps API is therefore a non-starter.
You could try to do so but i bet your OSMDroid map would display one or two tiles maximum and after that all subsequent tile requests would be refused.
CoPilot and Go - they both use the native Android MapView i guess rather than a 3rd party MapView such as OSMDroid.
The official native Android MapView obviously has permission to access Google's tile.
I have tried to make a B4A library with the native Android MapView but failed - take a look here for more info.
Did you look at the offline tiles examples?
You could download all the tiles for your hometown and bundle them with your app.
Or look at creating a free Cloudmade account, get a Cloudmade API key and add Cloudmade tiles to your app.
In theory the Cloudmade tile servers are faster than the Open Street Map servers so should load quicker.
Or of course you can go with the Google Maps API in a WebView but that's very cumbersome...
Martin.
Each zoom level is a directory, each column is a subdirectory, and each tile in that column is a file
Filename(url) format is /zoom/x/y.png
MyXYTileSource.Initialize("your_choosen_tilesource_name", minimum_zoom_level, maximum_zoom_level, 256, ".jpg", "http://localhost/")
ImageFileName LeftEdgeLong RightEdgeLong TopEdgeLat BtmEdgeLate
gm_118348_80442_17.png: 145.0524902 145.0552368 -37.8444948 -37.84666368
gm_118348_80443_17.png: 145.0524902 145.0552368 -37.84666368 -37.8488325
gm_118348_80444_17.png: 145.0524902 145.0552368 -37.8488325 -37.85100126
...
Project: C:\getallmaps\2012 05 07 0900.egmd
Now time is:7/05/2012 8:53:18 AM
[MapsType]
MapsType=0
Left Longitude input= 145.053847259521
Right Longitude input= 145.077794021606
Top Latitude input= -37.8456517362268
Bottom Latitude input= -37.8635428548458
MinX = 118348 'this may be what you're looking for to confirm x and y ????
MinY = 80442
MaxX = 118357
MaxY = 80450
Left Longitude download=145.052490234375
Right Longitude download=145.079956054688
Top Latitude download=-37.8444947955493
Bottom Latitude download=-37.8640124704472
All images' scope information are saved to C:\getallmaps\2012 05 07 0900_list.txt
Total count of images would be downloaded: 90
Download threads count: 8
Zoom level: 17
path: C:\getallmaps\
Start downloading...
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
T3:seq=2,gm_118348_80443_17.png OK
T2:seq=1,gm_118348_80442_17.png OK
T1:seq=8,gm_118348_80449_17.png OK
T4:seq=3,gm_118348_80444_17.png OK
T6:seq=5,gm_118348_80446_17.png OK
T5:seq=4,gm_118348_80445_17.png OK
T8:seq=7,gm_118348_80448_17.png OK
T7:seq=6,gm_118348_80447_17.png OK
T3:seq=10,gm_118349_80442_17.png OK
T2:seq=9,gm_118348_80450_17.png OK
T1:seq=16,gm_118349_80448_17.png OK
T4:seq=11,gm_118349_80443_17.png OK
T5:seq=12,gm_118349_80444_17.png OK
T8:seq=15,gm_118349_80447_17.png OK
T6:seq=13,gm_118349_80445_17.png OK
T7:seq=14,gm_118349_80446_17.png OK
T3:seq=18,gm_118349_80450_17.png OK
T2:seq=17,gm_118349_80449_17.png OK
T1:seq=24,gm_118350_80447_17.png OK
T4:seq=19,gm_118350_80442_17.png OK
T5:seq=20,gm_118350_80443_17.png OK
T6:seq=21,gm_118350_80444_17.png OK
T8:seq=23,gm_118350_80446_17.png OK
T7:seq=22,gm_118350_80445_17.png OK
T3:seq=26,gm_118350_80449_17.png OK
T2:seq=25,gm_118350_80448_17.png OK
T1:seq=32,gm_118351_80446_17.png OK
T4:seq=27,gm_118350_80450_17.png OK
T5:seq=28,gm_118351_80442_17.png OK
T6:seq=29,gm_118351_80443_17.png OK
T8:seq=31,gm_118351_80445_17.png OK
T7:seq=30,gm_118351_80444_17.png OK
T2:seq=33,gm_118351_80447_17.png OK
T3:seq=34,gm_118351_80448_17.png OK
T1:seq=40,gm_118352_80445_17.png OK
T5:seq=36,gm_118351_80450_17.png OK
T4:seq=35,gm_118351_80449_17.png OK
T6:seq=37,gm_118352_80442_17.png OK
T8:seq=39,gm_118352_80444_17.png OK
T7:seq=38,gm_118352_80443_17.png OK
T1:seq=48,gm_118353_80444_17.png OK
T3:seq=42,gm_118352_80447_17.png OK
T2:seq=41,gm_118352_80446_17.png OK
T5:seq=44,gm_118352_80449_17.png OK
T4:seq=43,gm_118352_80448_17.png OK
T6:seq=45,gm_118352_80450_17.png OK
T8:seq=47,gm_118353_80443_17.png OK
T7:seq=46,gm_118353_80442_17.png OK
T1:seq=56,gm_118354_80443_17.png OK
T3:seq=50,gm_118353_80446_17.png OK
T2:seq=49,gm_118353_80445_17.png OK
T5:seq=52,gm_118353_80448_17.png OK
T4:seq=51,gm_118353_80447_17.png OK
T6:seq=53,gm_118353_80449_17.png OK
T8:seq=55,gm_118354_80442_17.png OK
T7:seq=54,gm_118353_80450_17.png OK
T3:seq=58,gm_118354_80445_17.png OK
T2:seq=57,gm_118354_80444_17.png OK
T1:seq=64,gm_118355_80442_17.png OK
T4:seq=59,gm_118354_80446_17.png OK
T5:seq=60,gm_118354_80447_17.png OK
T6:seq=61,gm_118354_80448_17.png OK
T8:seq=63,gm_118354_80450_17.png OK
T7:seq=62,gm_118354_80449_17.png OK
T3:seq=66,gm_118355_80444_17.png OK
T2:seq=65,gm_118355_80443_17.png OK
T1:seq=72,gm_118355_80450_17.png OK
T6:seq=69,gm_118355_80447_17.png OK
T4:seq=67,gm_118355_80445_17.png OK
T5:seq=68,gm_118355_80446_17.png OK
T8:seq=71,gm_118355_80449_17.png OK
T3:seq=74,gm_118356_80443_17.png OK
T7:seq=70,gm_118355_80448_17.png OK
T2:seq=73,gm_118356_80442_17.png OK
T6:seq=77,gm_118356_80446_17.png OK
T1:seq=80,gm_118356_80449_17.png OK
T4:seq=75,gm_118356_80444_17.png OK
T8:seq=79,gm_118356_80448_17.png OK
T5:seq=76,gm_118356_80445_17.png OK
T3:seq=82,gm_118357_80442_17.png OK
T7:seq=78,gm_118356_80447_17.png OK
T2:seq=81,gm_118356_80450_17.png OK
T1:seq=88,gm_118357_80448_17.png OK
T4:seq=83,gm_118357_80443_17.png OK
T6:seq=85,gm_118357_80445_17.png OK
T8:seq=87,gm_118357_80447_17.png OK
T5:seq=84,gm_118357_80444_17.png OK
T3:seq=90,gm_118357_80450_17.png OK
T7:seq=86,gm_118357_80446_17.png OK
T1 Finished.
T4 Finished.
T6 Finished.
T8 Finished.
T2:seq=89,gm_118357_80449_17.png OK
T5 Finished.
T3 Finished.
T7 Finished.
T2 Finished.
--------------------------------
Task Stoped!
Now time:7/05/2012 8:53:34 AM
Log file has been saved as C:\getallmaps\2012 05 07 0900_log.txt
I couldn't get OSMDroid examples after 6 to work on my phone.
Can't recall why now.
We use cookies and similar technologies for the following purposes:
Do you accept cookies and these technologies?
We use cookies and similar technologies for the following purposes:
Do you accept cookies and these technologies?