CGDevTools Forum

Welcome to the Official CGDevTools Support Community Forums.

use map with custom images

by FredT » 28 Jan 2019 15:36

Do you have a basic Map component (ie not linked by default to a Google map) to browse our own images ?

Thank.
FredT
 
Posts: 28
Joined: 28 Jan 2019 15:10

by Alexander Bulei » 28 Jan 2019 18:37

Hi FredT,

I think, you need to check the MapQuery component and demo (JQueryDemoV3_IW14).

Best Regards.
Group: Developers | Support Team

  • info [at] cgdevtools.com - General information
  • sales [at] cgdevtools.com - Sales department
  • support [at] cgdevtools.com - Product and Technical Support
User avatar
Alexander Bulei
Site Admin
 
Posts: 3635
Joined: 15 May 2012 08:52
Location: Mealhada, Portugal

by FredT » 31 Jan 2019 12:13

Hi,

About the MapQuery component, what is the format of the file that we put in Url?
(Http://vmap0.tiles.osgeo.org/wms/vmap0) Is it an image file, an html file?

I tried this:

I used the MapTilerDesktop software to generate the tiles from my image: it generated me a html file, a json file containing the coordinates of the tiles and finally the tiles themselves. (When I open html file, it works perfectly)

Then I filled in the properties of MapQuery, with the html file in Url:

Layer: = IWCGJQMapQuery.MapQueryOptions.Layers.Add;
Layer.LayerType: = mqltWMS;
Layer.LayerOptionsWMS.Url: = 'http://...IP.../openlayers.html';
Layer.LayerOptionsWMS.Layers: = 'basic';

But it does not matter.

Thank
FredT
 
Posts: 28
Joined: 28 Jan 2019 15:10

by Alexander Bulei » 04 Feb 2019 10:38

Hi FredT,

Please check our main demo for the component usage, but I'm not sure if it supports your tile server...

Best Regards.
Group: Developers | Support Team

  • info [at] cgdevtools.com - General information
  • sales [at] cgdevtools.com - Sales department
  • support [at] cgdevtools.com - Product and Technical Support
User avatar
Alexander Bulei
Site Admin
 
Posts: 3635
Joined: 15 May 2012 08:52
Location: Mealhada, Portugal

by FredT » 04 Feb 2019 12:35

Hi,

I looked at the demos, and I understood that the GMap and GMap3 components worked exclusively with Google and maps, and that to display an image other than a map you had to use the MapQuery component.

But I do not understand how?

What I want to do is turn an image into a tile map and then open it in your Map component.

How to do it?
What method should I use to create my tiled images in a format readable by your Map component?
Taking into account that the images I want to use are not maps and not coordinate systems.

Thank you
FredT
 
Posts: 28
Joined: 28 Jan 2019 15:10

by assapan » 18 Feb 2019 15:46

I did it last year , let me some time to check and i'll try to explain
Want to visit Ardeche http://leclosdelarc.fr/index.php
The Pont d’Arc Cavern http://en.cavernedupontdarc.fr
Image
User avatar
assapan
 
Posts: 600
Joined: 16 Dec 2013 12:04
Location: France

by assapan » 19 Feb 2019 12:23

Hi,
Have a look to this to check if it's what you want http://gdv.assapan.fr:8889

in order to do that you must set

Code: Select all
      Map.JQGMapV3Options.ImageMapType.Id := 'test';
      Map.JQGMapV3Options.ImageMapType.Options.MaxZoom := 9;
      Map.JQGMapV3Options.ImageMapType.Options.MinZoom := 6;
      Map.JQGMapV3Options.ImageMapType.Options.Name := 'test';
      Map.JQGMapV3Options.ImageMapType.Options.TileSize.Width := 256;
      Map.JQGMapV3Options.ImageMapType.Options.TileSize.Height := 256;
      Map.JQGMapV3Options.Map.Options.MapTypeCustomId := 'test';
      L := TStringList.Create;
      L.LoadFromFile(WebApplication.ApplicationPath + 'myMap.js');
      Map.JQGMapV3Options.ImageMapType.Options.GetTileUrl.Script := L.Text;
      L.Free;


and in myMap.js
Code: Select all
function coordonnees(coord, zoom) {
    var getNormalizedCoord = function (c, z) {
        var y = c.y;
        var x = c.x;
        var tileRange = 1 << z;
        if (y < 0 || y >= tileRange) {
            return null;
        }
        if (x < 0 || x >= tileRange) {
            x = (x % tileRange + tileRange) % tileRange;
        }
        return {x: x, y: y};
    }

    var normalizedCoord = getNormalizedCoord(coord, zoom);
    if (!normalizedCoord) {
        return null;
    }
    var bound = Math.pow(2, zoom);
    var x = normalizedCoord.x;
    var y = (bound - normalizedCoord.y - 1);
   img = 'http://yourserver/zoom' + zoom + '/' + x + '/'+zoom+'_'+x+'_' +y + '_new-min.png';
    return img;
}
Want to visit Ardeche http://leclosdelarc.fr/index.php
The Pont d’Arc Cavern http://en.cavernedupontdarc.fr
Image
User avatar
assapan
 
Posts: 600
Joined: 16 Dec 2013 12:04
Location: France

by assapan » 19 Feb 2019 12:32

Server directory
Image
Want to visit Ardeche http://leclosdelarc.fr/index.php
The Pont d’Arc Cavern http://en.cavernedupontdarc.fr
Image
User avatar
assapan
 
Posts: 600
Joined: 16 Dec 2013 12:04
Location: France

by FredT » 20 Feb 2019 12:35

Hi Assapan,

Your myMap.js file helped me understand the way tiled images work.

But how did you create the tiles from the original image ?
With an existing program or did you create them yourself ?

Thank
FredT
 
Posts: 28
Joined: 28 Jan 2019 15:10

by assapan » 20 Feb 2019 12:37

Hi,
I used MapTiler
Want to visit Ardeche http://leclosdelarc.fr/index.php
The Pont d’Arc Cavern http://en.cavernedupontdarc.fr
Image
User avatar
assapan
 
Posts: 600
Joined: 16 Dec 2013 12:04
Location: France

Next

Return to JQGMap

Who is online

Users browsing this forum: No registered users and 2 guests

Contact Us.