Topic: Multiple overlay / Shapefiles

Hi,

I have a couple of (related) questions. Firstly is it possible to use multiple overlays on a tileset map and if so can you capture which overlay element gets clicked? I have CAD files showing areas on a map that I would like to use as overlays, these overlays relate to specific areas and assets in the real world and I would like to let a user select the individual elements of the overlay.

In GIS I would probably convert them to shape files but I am aware that shape files are vector not raster graphics so would be of no use with Unity / OnlineMaps, is that correct? So I have considered drawing the shapes over the maptiles using the 'DrawingPoly' class, would this be performant enough in your opinion to create lots of these at runtime? Also I am thinking that by drawing the polys rather than using overlay tiles I could make use of the HitTest member of the OnlineMapsDrawingPoly class to check which poly / shape I have clicked, would this work in your opinion?

I am open to suggestions if you feel there would be a better way of implementing this functionality.

Thanks big_smile

Re: Multiple overlay / Shapefiles

Hello.

In Online Maps v2.4 is available 3 overlay layer (back, traffic, front).
Traffic layer is reserved for traffic, but it can still be used for a custom overlay.

Another way - is to draw overlay over the map.
http://infinity-code.com/atlas/online-m … ample.html
In this case, you can have an unlimited number of layers.

Unfortunately, there is no built-in way to determine on which overlay is clicked.
But you can do it this way:
• Get clicking coordinate.
• Convert it into the tile coordinates.
• Check pixel each overlay layers. If pixel of layer is not transparent, then clicked on the layer.

Using Drawing API will be very, very slowly.
The best way - it is rasterized shapefiles, and used as overlay.

Kind Regards,
Infinity Code Team.

Boost your productivity a lot and immediately using Ultimate Editor Enhancer. Trial and non-commerce versions available.

Re: Multiple overlay / Shapefiles

Hi,

Thanks for the reply Alex. So I am doing some experiments with both methods today as I want to see at which point the Drawing API becomes problematic. The problem I'm having is the polys I draw are not filled, no matter what I set the background colour and alpha to I only see the outline in the game window? See attached screenshot.

I am on the latest OSX with the latest OnlineMaps & Unity 5.3.4p4.

Any ideas?

Post's attachments

Attachment icon Screen Shot 2016-06-24 at 12.52.22 (2).png 598.56 kb, 123 downloads since 2016-06-24 

Re: Multiple overlay / Shapefiles

This is a known problem that we have described in the documentation.
Most likely, this problem will never be solved.

There is one way to have filled the polygons in the Tileset, but it works very slowly and can be used only in specific cases.
Example attached.

Post's attachments

Attachment icon TestDrawingAPIWithElevation.cs 5.58 kb, 151 downloads since 2016-06-24 

Kind Regards,
Infinity Code Team.

Boost your productivity a lot and immediately using Ultimate Editor Enhancer. Trial and non-commerce versions available.