Re: Method addPolylineByCoordsArray

34 views
Skip to first unread message

Brad Wedell

unread,
Dec 9, 2013, 1:23:41 PM12/9/13
to php-googl...@googlegroups.com
Array format should be:
addPolylineByCoordsArray(
    array(
        array("lat"=>"45.076770", "long"=>"11.786430"),
        array("lat"=>"45.076770", "long"=>"11.786430"),
         array("lat"=>"45.076770", "long"=>"11.786430"),
    )
);

Alternatively, you could probably use address lookup by passing them as a string:
addPolyLineByAddressArray(
    array("45.076770, 11.786430", "45.076770, 11.786430", "45.076770, 11.786430")
)
 


On Mon, Dec 9, 2013 at 7:20 AM, Marco Argenti <marco....@gmail.com> wrote:
Hi!
I'm trying to use the method addPolylineByCoordsArray but I can't understand where I'm wrong, this is the code:

<?php
include_once("GoogleMap.php");
include_once("JSMin.php");

$MAP_OBJECT = new GoogleMapAPI(); 
$MAP_OBJECT->_minify_js = isset($_REQUEST["min"])?FALSE:TRUE;
$MAP_OBJECT->disableSidebar();
$MAP_OBJECT->setMapType("ROADMAP");
$MAP_OBJECT->width='690px'; 
$MAP_OBJECT->height='580px'; 

// Aggiungo un ciclo che aggiunge le polylines
$polylinearray = array('45.076770', '11.786430', '45.068820', '11.788890', '45.071030', '11.793560', '45.072910', '11.788200', '45.070080', '11.790730');
$MAP_OBJECT->addPolylineByCoordsArray($polylinearray, false, '#FF0000', 1, 0);

?>
<html>
<head>
<?php echo $MAP_OBJECT->getHeaderJS();?>
<?php echo $MAP_OBJECT->getMapJS();?>
</head>
<body>
<?php echo $MAP_OBJECT->printOnLoad();?> 
<?php echo $MAP_OBJECT->printMap();?>
</body>
</html>

The output is completely wroing, so I checked the source code and I see that in javascript code there are coordinates (1,1) and (4,4)

What's the right syntax of the $polylinearray?

Thanks!

--
You received this message because you are subscribed to the Google Groups "PHP GoogleMapAPI Class " group.
To unsubscribe from this group and stop receiving emails from it, send an email to php-google-map-...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Reply all
Reply to author
Forward
0 new messages