Skip Navigation

[Gelöst] Draw polylines into Toolset Maps | #559

This support ticket is created vor 2 Jahre, 7 Monate. 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.

No supporters are available to work today on Toolset forum. Feel free to create tickets and we will handle it as soon as we are online. Thank you for your understanding.

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 Antworten, has 3 Stimmen.

Last updated by Waqar vor 2 Jahre, 7 Monate.

Assisted by: Waqar.

Author
Artikel
#2177401

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

#2177469

Nigel
Supporter

Languages: Englisch (English ) Spanisch (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: Englisch (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.