Visualization of map scale

This forum covers all questions dealing with visualization of data within the native PTV xMap interface and the
PTV Developer Raster Maps API
Please remember that additional plugins such as AJAX or Leaflet may be handeled in other forums.
Post Reply
User avatar
Bernd Welter
Site Admin
Posts: 2695
Joined: Mon Apr 14, 2014 10:28 am
Contact:

Visualization of map scale

Post by Bernd Welter »

Hi there,

in older versions of PTV based mapping interfaces there used to be a map scale on the bottom of the map. Now some players asked me where they could switch the visualization of the scale (on/off). The answer to that question is "that depends on the framework you use".

And here's why: through the years the visualization of mapping interfaces performed an evolution
  • from "single tile with control size"
  • to "multiple background tiles + global foreground layers" (both approaches had to deal with the non stable rendering)
  • and finally to a "multiple background tiles" (possible because we implemented stable rendering in xMap2)
With the last stage the necessity of "the map engine itself renders the scale" is no longer given. Nowadays the rendering of scales is done on the mapping framework in use, e.g. Leaflet or xServer.Net. I attached some screenshots so you can compare the output.
mash up approach
mash up approach
If your mapping framework doesn't support a scale from a native perspective you could use this code to determine
  • whether you want to display the scale or not (depends on the min/max latitude)
  • what scale to apply (based on the latitude of your choice)
Here's also some fancy code from Oliver that shows how we apply this native scale in xServer.NET.

Bernd
Attachments
Ajaxmaps (xMap1)
Ajaxmaps (xMap1)
mapscale-ajaxmaps.PNG (65.62 KiB) Viewed 6887 times
LEAFLET  +  PTV XMapServer (2)
LEAFLET + PTV XMapServer (2)
mapscale-leaflet.PNG (7.51 KiB) Viewed 6887 times
xServer.NET + PTV xMapServer 1
xServer.NET + PTV xMapServer 1
xServer.NET + PTV xMapServer 1
xServer.NET + PTV xMapServer 1
PTV Map&Guide Internet (powered by PTV xMapServer1)
PTV Map&Guide Internet (powered by PTV xMapServer1)
mapscale-MGI.PNG (22.12 KiB) Viewed 6887 times
MAP&GUIDE Desktop (powered my PTV MapServer)
MAP&GUIDE Desktop (powered my PTV MapServer)
Bernd Welter
Technical Partner Manager Developer Components
PTV Logistics - Germany

Bernd at... The Forum,LinkedIn, Youtube, StackOverflow
I like the smell of PTV Developer in the morning... :twisted:
Post Reply