PHPFixing
  • Privacy Policy
  • TOS
  • Ask Question
  • Contact Us
  • Home
  • PHP
  • Programming
  • SQL Injection
  • Web3.0

Friday, April 22, 2022

[FIXED] How to add many GoogleMaps-Marker in cakePHP on a map

 April 22, 2022     cakephp, cakephp-2.3, google-maps, helper, view     No comments   

Issue

i've an little AddressDB with about 100 Addresses. So now i added the Helpper from https://github.com/marcferna/CakePHP-GoogleMapHelper.

I know how i can add on address to the view. But how do i add all the addresses to one map?

Can every help me please?

Many thanks in advance

Marcus


Solution

Why are you adding a comma?

<?php $this->GoogleMap->addMarker("map_canvas",1, $atla['Atla']['street'].' '.$atla['Atla']['number'].', '.$atla['Atla']['zipcode'].' '.$atla['Atla']['city'],$atla['Atla']['name'])?> <?php endforeach; ?>

should probably be

<?php $this->GoogleMap->addMarker("map_canvas",1, $atla['Atla']['street'].' '.$atla['Atla']['number'].', '.$atla['Atla']['zipcode'].' '.$atla['Atla']['city'].','.$atla['Atla']['name'])?> <?php endforeach; ?>

But: How about http://www.dereuromark.de/2010/12/21/googlemapsv3-cakephp-helper/ ? It is probably a more complete alternative.

As documented you can use

$this->GoogleMapV3->addMarker($options);

any many times as you want. I tried it with 500 and - although at this point you might want to switch to clusters - it still worked.



Answered By - mark
Answer Checked By - Dawn Plyler (PHPFixing Volunteer)
  • Share This:  
  •  Facebook
  •  Twitter
  •  Stumble
  •  Digg
Newer Post Older Post Home

0 Comments:

Post a Comment

Note: Only a member of this blog may post a comment.

Total Pageviews

Featured Post

Why Learn PHP Programming

Why Learn PHP Programming A widely-used open source scripting language PHP is one of the most popular programming languages in the world. It...

Subscribe To

Posts
Atom
Posts
Comments
Atom
Comments

Copyright © PHPFixing