fanningert / kirbycms-extension-gmaps

This is a Kirbytag to integrate Google Maps API in your website
GNU General Public License v3.0
10 stars 2 forks source link

Add complex marker/kml support #3

Closed fanningert closed 8 years ago

fanningert commented 9 years ago

This are only ideas for the final solution.

Support for complex marker via JSON-Array. Before I insert the attribute, I need to stringify the json array/object to a string.

(googlemaps lat: LAT lng: LNG marker: [{ "lat" : "LAT", "lng" : "LNG", "text" : "TEXT" }...])

or

(googlemaps)
  (marker: TEXT lat: LAT lng: LNG)
  (marker lat: LAT lng: LNG)
    Content
  (/marker)
  ...
(/googlemaps)
<div class="googlemaps" data-googlemaps="true" data-marker="[{ "lat" : "", "lng" : "", "text" : "" }]"></div>

or

<div class="googlemaps" data-googlemaps="true">
  <div class="googlemaps-marker" data-marker-lat="" data-marker-lng="">Content</div>
  ...
</div>

Hint:

$('.delete').attr('data-foobar', JSON.stringify(data) );
var data = JSON.parse( $('.delete').attr('data-foobar') );
fanningert commented 8 years ago

Solved

(googlemaps)
  (marker title: TEXT lat: LAT lng: LNG)
  (marker lat: LAT lng: LNG)
    Content
  (/marker)
  ...
(/googlemaps)