Skip Navigation

[Resolved] Draw polylines into Toolset Maps | #559

This support ticket is created 2 years, 7 months ago. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Sun Mon Tue Wed Thu Fri Sat
- 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 -
- 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 -

Supporter timezone: Asia/Karachi (GMT+05:00)

This topic contains 3 replies, has 3 voices.

Last updated by Waqar 2 years, 7 months ago.

Assisted by: Waqar.

Author
Posts
#2177401

Hi,
How complicated would it be to add ability to draw polylines with Toolset Maps for backend users?
Thanks.

#2177469

Nigel
Supporter

Languages: English (English ) Spanish (Español )

Timezone: Europe/London (GMT+01:00)

You want users to be able to draw on a map and... save the drawings?

That's not an available feature and would require a bespoke solution.

To give you an idea of the kind of thing that is involved in drawing on a Toolset map programmatically, you can check this code snippet by way of an example: hidden link

#2177485

Sorry I can't see the snippet; it says I must login as a contractor.
Thanks.

#2178219

Waqar
Supporter

Languages: English (English )

Timezone: Asia/Karachi (GMT+05:00)

Hi,

Thanks for writing back.

Here is the snippet that Nigel referred to:

Add the following code to the content template’s JS box and change the mapid and center value as per the actual requirement.


jQuery(document).ready(function($){

$( document ).on('js_event_wpv_addon_maps_init_map_completed', function( event, event_settings ) {
// Get the map using our .get_map() method...
var mapid = 'map-11';
var myMap = WPViews.view_addon_maps.get_map(mapid);

// center value
var center = new google.maps.LatLng(21.7644725, 72.1519304);

// And then use Maps API .setOptions() method to programmatically change any option on the map.
var coverageCircle = new google.maps.Circle({
strokeColor: '#FF0000',
strokeOpacity: 0.8,
strokeWeight: 2,
fillColor: '#FF0000',
fillOpacity: 0.35,
map: myMap,
center: center,
radius: 100,
});

} );

} );

You'll find a more relevant example snippet for polylines in this thread:
https://toolset.com/forums/topic/add-lines-connecting-markers-in-a-google-map/

regards,
Waqar

This ticket is now closed. If you're a WPML client and need related help, please open a new support ticket.