ThinkGeo.com    |     Blog    |     Wiki    |     Support

Custom ContextMenu only works on features within the initial loading of the map

Hi Thinkgeo Community,

We are currently having an issue with our context menu on the Firefox browser and similar issues on other browsers. We are not using the context menu supplied through ThinkGeo but are currently appending a Telerik contextmenu to each of our LineString features through jquery and iterating through each client side feature. Each of our linestrings are also children of MultiLineString features. This functionality works fine if all features are within the initial loading of the map. The issue is, whenever there is a ajaxified postback of some kind to zoom to a linestring the map will reload only the svg polylines within the new extent. All the features within the inital extent work great with our context menu. When we pan or zoom around and try opening the context menu of other features the context menu doesn’t open.

Demo of Issue: https://ncrook-devmecca.tinytake.com/tt/MzY3NzY0Ml8xMTE2MjczNQ

Firefox Developer Tools image of the Inspector tab: https://ncrook-devmecca.tinytake.com/tt/MzY3NzY0NF8xMTE2MjczOA

We were curious if you have any suggestions in maintaining that contextmenu event on the objects? What are the client side events of the map to capture panning and zooming?

Any help would be greatly appreciated!

Thank you,
Neil

Hi Neil,

Thanks to let us know it.

We will try to reproduce that first and look into what’s the problem.

Could you please let us know your detail map version, your browser version and if there are some code about how you generate the ContextMenu which should be helpful.

Regards,

Ethan

Hi Neil,

I build a simple sample, which add the context menu to map like this:

            ContextMenu cm = new ContextMenu();
            cm.MenuItems.Add(new ContextMenuItem("test1"));
            cm.MenuItems.Add(new ContextMenuItem("test2"));                
            cm.MenuItems.Add(new ContextMenuItem("test3"));
            cm.MenuItems.Add(new ContextMenuItem("test4"));

            Map1.ContextMenu = cm;

I tested it in Chrome, IE and FireFox(version 68.0.1 64-bit), but I hadn’t reproduced it succeed.

I think maybe a project which can reproduce it should be helpful, do you think you can build a sample for that?

Regards,

Ethan