Forum
Perch Map template
Does the standard Perch 'map' template store any latlng or geocoded coordinates at all? I'm looking at adding a geocode fieldtype to do this, but want to check before I take the plunge! Thanks.
Does the standard Perch 'map' template store any latlng or geocoded coordinates at all? I'm looking at adding a geocode fieldtype to do this, but want to check before I take the plunge! Thanks.
Yes, it stores the lat and lng.
OK. I can't seem to retrieve it from skip-template.
Just gives me the address I entered in the form for that particular location.
Yes, I think you're right.
So how can I retrieve the lat and lng?
I don't think you'll be able to from the fieldtype as it stands. Instead of creating a new fieldtype, you could just copy the map one and modify it to your needs, however.
OK. I haven't modified a fieldtype before. Where should I start?
I thought your original plan was to create a new field type.
It was, but your previous reply suggested modifying the existing Perch map rather than creating a new field type. I assumed that meant going into perch/core somewhere?
You can create your own Field Types from scratch but it might be simpler to take one of ours as a starting point. That's up to you of course but whichever it isn't going to involve modifying Perch Core. You would take the Field Type, rename it, put it into the addons/fieldtypes folder as normal and then make your changes.
https://docs.grabaperch.com/api/field-types/
OK great. Thanks Rachel.