Can I render multiple points to the same map?

Created by Brian Armstrong on on 2009-12-03

Yes, as of version 1.0.4 it is now possible to render multiple points to the same map. This can be accomplished in two ways: 1) by rendering multiple results to the same container, 2) by manually specifying the lat/lon where the marker is to be placed.


// $result is an array of GeoCode_Result objects from a Google Driver
$result[0]->renderMap('map_canvas', array(
    'mapTypeId' => 'ROADMAP',
    'zoom' => 13

// Render the second result to the same map
// Any options passed to the function will be ignored
// since this canvas has already been initialized

// Render a point manually to that same canvas
// Arguments are in this order because if no canvas is
// specified, it defaults to using the last one created
$result[0]->renderPoint($my_lat, $my_lon, 'map_canvas');