Jump to:

5517 Posts in 1734 Topics by 1222 members

Customising the CMS

SilverStripe Forums » Customising the CMS » Google Maps full API - polyline

Moderators: martimiz, Sean, biapar, Willr, Ingo, swaiba, simon_w

Page: 1
Go to End
Author Topic: 1526 Views
  • snaip
    Avatar
    Community Member
    180 Posts

    Google Maps full API - polyline Link to this post

    hi

    is there any way to drawing polyline in back-end ?

    for example:
    1. create new Tour Page
    2. in tab called Google Maps is form to puts geometric values of the new point on the map
    3. in the same Google Maps tab is a button called "create another point" - generate new input type text (2x) (some JQuery, AJAX ?)
    4. than i have for example 10 points
    5. in front-end i genarate polyline on base these points

  • Hamish
    Avatar
    Community Member
    712 Posts

    Re: Google Maps full API - polyline Link to this post

    It's certainly possible - I'm doing something similar with polygons and OpenLayers.

    Basically you need to create a composite field that consists of the map and the hidden field that stores a serialized version of the line. You'll need to write the javascript to create the line creation interface and writing the data to the hidden field, then when the field is saved, store it as a polyline (have a look at the GIS module for an idea of how to go about doing this). This way, it is a format that is relatively easy to populate google maps again later.

    This should get you started - it's an involved process, but is doable. Definitely have a look at the GIS module!

    Of course, if you interested in paying someone to do it, I specialize in GIS services ;-D.

  • snaip
    Avatar
    Community Member
    180 Posts

    Re: Google Maps full API - polyline Link to this post

    I downloaded it but after db/build i don't have any new PageType

    so ? how to use it ?

    SS 2.3.1.

  • Hamish
    Avatar
    Community Member
    712 Posts

    Re: Google Maps full API - polyline Link to this post

    The GIS module doesn't contain any new page types. It contains the database fields, form fields, search filters and a few other bits and pieces that you need to start creating your own GIS-enabled objects.

    For example:

    class Office extends DataObject {

       static $db = array(
          'Name' => 'Varchar(40)',
          'Location' => 'GeoPoint'
       );

    }

    Like I said, you'll need to look at the code. I also suggest you read this:

    http://dev.mysql.com/doc/refman/5.0/en/spatial-extensions.html

    Note that there is also a "Maps" module (specifically for google maps) that might be more useful for you.

    http://open.silverstripe.com/browser/modules/maps/trunk

    1526 Views
Page: 1
Go to Top

Want to know more about the company that brought you SilverStripe? Then check out SilverStripe.com

Comments on this website? Please give feedback.