MapView - Layer with street and town names
Posted
#1
(In Topic #619)
Regular

What I see right now for the coordinates 52.52033763987445, 13.376083912073048 is the following
InLat=52.52033763987445 and InLon=13.376083912073048
Code (gambas)
- Inc iCounter
- iZoom = 13
- sTileName = "OpenStreetMap"
- sTilePattern = "http://\{s}.tile.openstreetmap.org/\{z}/\{x}/\{y}.png"
- cArguments = Null
- sCacheName = Null
- Debug RB_Openstreetmap.Value
- Debug RB_GoogleMaps.Value
- sTileName = "OpenStreetMap"
- MapView1.Map.AddTile(sTileName, sTilePattern, cArguments, sCacheName)
- MapView1.Map[sTileName].Copyright = " © OpenStreetMap"
- sTileName = "GoogleMaps"
- MapView1.Map.AddTile("GoogleMaps", "https://khms\{s}.google.it/kh/v=\{version}&src=app&x=\{x}&y=\{y}&z=\{z}&s=Galile", ["version": "869"]).SubDomains = ["0", "1", "2"]
- MapView1.Map[sTileName].Copyright = " © GoogleMaps"
- sTileName = "VirtualEarth"
- MapView1.Map.AddTile(sTileName, "http://ecn.dynamic.t\{s}.tiles.virtualearth.net/comp/ch/\{q}?mkt=fr-fr&it=G,VE,BX,L,LA&shading=hill&n=z&cb=1").SubDomains = ["0", "1", "2"]
- MapView1.Map[sTileName].Copyright = " © VirtualEarth"
- MapView1.Map.DefaultCache = "/tmp"
- MapView1.Map.AddShape("P" & iCounter)
- 'MapView1.Map!P1.AddPoint(sPoint, MapPoint(fLatitude, fLongitude))
- MapView1.Map["P" & iCounter].AddPoint(sPoint, MapPoint(fLatitude, fLongitude))
- MapView1.Map.Center = MapPoint(fLatitude, fLongitude)
- MapView1.Map.Zoom = iZoom
- End ' ShowMap()
Any ideas?
Posted
Guru

Normal view
Satellite view
Terrain view
Traffic view
The URLs are: -
Google Maps
Google Maps
Google Maps
Google Maps
Posted
Regular

So for a Road Map:-
Code
MapView1.Map.AddTile("GoogleMap", "http://mt0.google.com/vt/lyrs=m&hl=en&x=\{x}&y=\{y}&z=\{z}")Satellite:-
Code
MapView1.Map.AddTile("GoogleMap", "http://mt0.google.com/vt/lyrs=s&hl=en&x=\{x}&y=\{y}&z=\{z}")Terrain:-
Code
MapView1.Map.AddTile("GoogleMap", "http://mt0.google.com/vt/lyrs=t&hl=en&x=\{x}&y=\{y}&z=\{z}")Its the "p&hl" bit that changes.
Posted
Regular

How is life in Guernsey? Must be a lovely spot especially in time of Covid-19.
What do you mean exactly?Its the "p&hl" bit that changes.
Thanks you both of you. I'll try (and error) in the next couple of days.
Another question is about raw files. Filemanager Dolphin and others provide a preview of a raw file *.DNG. FileView ind Gambas doesn't. Can I train FileView somehow to show a preview of DNG-files?
Posted
Regular

That layer is described as Terrain Only so I guess that's what you are getting. Try this one:-01McAc said
…@stevedee: Road map and satellite both work but terrain shows just a black rough surface in mapview.
Code
MapView1.Map.AddTile("GoogleMap", "http://mt0.google.com/vt/lyrs=p&hl=en&x=\{x}&y=\{y}&z=\{z}").Copyright = "© GoogleMaps"Its the "p&hl" bit that changes.
What do you mean exactly?
The only bit that changes in this sequence of "patterns" for different Layers is: "m&hl"…"p&hl" … "s&hl" … "t&hl" … "y&hl" … "r&hl
…Can I train FileView somehow to show a preview of DNG-files?
You will need a utility to either convert RAW into another format or to extract the small jpeg image that is embedded in RAW files.
Note that DNG is just one RAW format. Most camera manufacturers have their own format.
Posted
Regular

01McAc said
…@stevedee: Road map and satellite both work but terrain shows just a black rough surface in mapview…
Yes the Terrain Only Pattern doesn't do anything.
But I found that "h" produces a strange map layer…
Posted
Guru

stevedee said
That layer is described as Terrain Only so I guess that's what you are getting. Try this one:-01McAc said
…@stevedee: Road map and satellite both work but terrain shows just a black rough surface in mapview.
Code
MapView1.Map.AddTile("GoogleMap", "http://mt0.google.com/vt/lyrs=p&hl=en&x=\{x}&y=\{y}&z=\{z}").Copyright = "© GoogleMaps"
Its the "p&hl" bit that changes.
What do you mean exactly?
The only bit that changes in this sequence of "patterns" for different Layers is: "m&hl"…"p&hl" … "s&hl" … "t&hl" … "y&hl" … "r&hl
…Can I train FileView somehow to show a preview of DNG-files?
You will need a utility to either convert RAW into another format or to extract the small jpeg image that is embedded in RAW files.
Note that DNG is just one RAW format. Most camera manufacturers have their own format.
Does Image class not convert raw to jpg ?
My icon maker app loads all manner of image types and saves as many different types even .ico but all it uses is Image.Load() Image.Save()
I'm not entirely sure what you are doing but i get the feeling Image class is your friend here being able to load many formats and even extract parts of an image.
All the best
Posted
Regular

Unfortunately not. When I load the DNG fileDoes Image class not convert raw to jpg ?
Code (gambas)
there are a few messages from the interpreter in the debug window:
TIFFReadDirectory: Warning, Unknown field with tag 51125 (0xc7b5) encountered.
foo: Sorry, can not handle image with PhotometricInterpretation=32803.
and the code stopped working with an error message saying
Code
Unable to load image in FMain:123Image types like jpg, png, ico, etc are not a problem.
Posted
Regular

Yes indeed. MapSD is quite a cool little program. A nice demonstration what Gambas is capable of - with just a few lines of code.stevedee said
But I found that "h" produces a strange map layer…
How do you know the URLs? I haven't found any documention re Google Maps. Common knowlege?
Posted
Guru

@cogier: I'll have close look into the PhotoExif program tomorrow. After a first quick run through it looks 'wow' but throws an error when clicked and changed to another directory. It is very interesting how the exif information gets extracted. My app is much simpler and just focused on GPS and the mapview.
I would be interested in finding the error and sorting it. Can you let me know what Distro you are running, what you did to create the error, what and where it is.
I don't want to live anywhere else. We had a few cases of Covid-19 pop up in January, but it's all under control, no new cases for 19 days, and if all stays that way we will free from lock down restraints on Monday (22/03).How is life in Guernsey? Must be a lovely spot especially in time of Covid-19.
Posted
Regular

01McAc said
…How do you know the URLs? I haven't found any documention re Google Maps. Common knowlege?
I did a lot of searching. Seem to get lucky on sites where users are quoting this stuff for other programming languages.
Posted
Regular

I would be interested in finding the error and sorting it. Can you let me know what Distro you are running, what you did to create the error, what and where it is.
Here it is.
I attached the jpg image which caused the errror. I suppose someone has lost his armchair.
Posted
Guru

<IMG src="https://www.cogier.com/gambas/NoError.png">
</IMG>
Posted
Regular

I think it's not actually a bug rather than a national interpretation of numbers. When the 'error' occurs I've got the following numberscogier said
Thanks for the reply and the picture, but I could not recreate the error.
sLatArray[2] = 37.58
Val(sLatArray[2]) = NULL
So why NULL? In Germany Val("37,58") is equal to 37,58 (which is correct)
I might switch to English but I don't find the settings in the IDE.
cogier said
Expensive camera
Once in a lifetime. I presume I am the one of five people in the world using this camera, post process with open source with Linux
Posted
Guru

So why NULL? In Germany Val("37,58") is equal to 37,58 (which is correct)
I didn't think of that. Can you try adding the 'New' code below, and let me know if that works for you in your German setup. If it does it should work for other languages as well.
Code (gambas)
Once in a lifetime. I presume I am the one of five people in the world using this camera, post process with open source with Linux![]()
Good for you. Puts my Canon 6D MkII in its place! I also use Linux for all my photography.
Posted
Regular

When I type Val("2.2") into the console the result is "02.02.2021 00:00:00"
Then I replaced your condition with the code
Code (gambas)
This condition becomes true but
Code (gambas)
The following code works but I suppose it is not very elegant:
Code (gambas)
All in all this is actually the application I was looking for. I just need to enhance it to raw files.
Posted
Regular

01McAc said
The following code works
Continued some tests. My code is not reliable, sorry. It doesn't work for all jpg's. I don't know, why.
I did notice you are using exiftool to extract the exif tags. I use the following parameter to get the correct "GPS Position"-tag in degrees (e.g. 54.989667). No calculation is necessary:
Posted
Guru

Posted
Regular

I am currently working on my own Exif2Map app
I copied one or another idea from your project PhotoEXIF. In particular I embraced the AutoResize and Expand functionality which I was (and still am) not familiar with. I'll provide an early beta version in Project Showcase subforum in the next few days.
1 guest and 0 members have just viewed this.




