Is it possible to plot multiple locations on the map?

Asked by streetdaddy

I would like to plot multiple addresses on the map with an automatic zoom level that encompasses all points.

Is this possible or could I extend the extension to do this?

Question information

Language:
English Edit question
Status:
Solved
For:
Yii GeoCoder Extension Edit question
Assignee:
Brian Armstrong Edit question
Solved by:
streetdaddy
Solved:
Last query:
Last reply:
Revision history for this message
Brian Armstrong (brian-killermonk) said :
#1

As of version 1.0.4 it is now possible to render multiple results to the same map.

Please see this FAQ article for more details on how to accomplish this: https://answers.launchpad.net/yiigeo/+faq/845

Revision history for this message
Brian Armstrong (brian-killermonk) said :
#2

Brian Armstrong suggests this article as an answer to your question:
FAQ #845: “Can I render multiple points to the same map?”.

Revision history for this message
Brian Armstrong (brian-killermonk) said :
#3

Solved

Revision history for this message
streetdaddy (streetdaddy) said :
#4

Sorry for the delayed response, I've only just started playing with the new version.

Would it be possible to add intelligent zoom similar to the work-around described here: http://www.codedblog.com/2007/09/28/how-to-auto-zoom-and-auto-center-google-maps/

Revision history for this message
streetdaddy (streetdaddy) said :
#5

I've made some simple changes to be able to insert javascript that will automatically zoom to contain all points.

 - Only works with map type google
 - Only use with multiple points
 - Rush job so not perfect

See patch here: (for 1.0.4 only)

http://www.pastie.org/733090

Example use (after multiple points have been rendered):

$result[0]->renderMap('my_map', array(
                    'mapTypeId' => 'ROADMAP',
                    'zoom' => 8
                ));

$result[1]->renderMap('my_map');

$result[0]->renderAutoZoom('my_map');

Revision history for this message
Brian Armstrong (brian-killermonk) said :
#6

I like your implementation. It looks like you have spent some time going over my code and seeing how it works. Your solution is also clean and straightforward. I think I will integrate this into the next release. Thank you.

I'm not sure when the next release will be, though. I have some other projects that I need to focus on, so this one is slightly on the back burner at the moment.

Revision history for this message
streetdaddy (streetdaddy) said :
#7

Cheers Brian, I'm glad you liked it. I'll be sure to contribute back any additions i make. I really like what you've created, it's perfect for my needs and easy to add more features and other map drivers.

Revision history for this message
Brian Armstrong (brian-killermonk) said :
#8

That's exactly how I tired to design it. I am glad that it is useful to someone else and fulfills the purpose of it's creation.