I'm using gmaps.js which is a great short hand way of implementing google maps, I am thinking of using it in Perch templates with repeaters for the markers.
The default map field type just supports one marker, because it's an input field. Think of it as collecting one point. If you have multiple points, use multiple fields.
How you display the points of your site is up to you.
Well I don't know where to start really as the output from the map generates 1 map per content item. I guess I will have to go an begin to rewrite public_maps.js and configure it to only output co-ordinates.
After that I will use this output in conjunction (incorporated) into the above javascript to finally output the map with multiple co-ordinates.
My basic start point is a repeater containing map items within it, allowing an easy process of adding multiple map markers. Once I can achieve the correct JS output as points I will add extra categories of markers as separate repeaters OR have a select in the region to define marker category.
I'm using gmaps.js which is a great short hand way of implementing google maps, I am thinking of using it in Perch templates with repeaters for the markers.
The default map field type just supports one marker, because it's an input field. Think of it as collecting one point. If you have multiple points, use multiple fields.
How you display the points of your site is up to you.
OK That's helpful thanks!
Has anyone else used Perch maps to generate multiple points?
Currently my JS looks like this (I'm using gmaps.js to generate maps):
Surely that's not all your JavaScript?
No of course not.
Here is the code:
Hopefully someone will be able to help.
What error are you getting? / How is it failing?
This javascript functionality works just fine, its the integration with perch that I'm struggling to get started with.
Where are you struggling? What does your template look like?
Well I don't know where to start really as the output from the map generates 1 map per content item. I guess I will have to go an begin to rewrite public_maps.js and configure it to only output co-ordinates.
After that I will use this output in conjunction (incorporated) into the above javascript to finally output the map with multiple co-ordinates.
My basic start point is a repeater containing map items within it, allowing an easy process of adding multiple map markers. Once I can achieve the correct JS output as points I will add extra categories of markers as separate repeaters OR have a select in the region to define marker category.
Just looking in my perch/addons/fieldtypes and there is no example custom field type there.
There won't be unless you've downloaded some. There are 5 examples on our site, and all the default field types are the same format.