Diferencia entre revisiones de «Colocar puntos en google maps»

De KumbiaPHP Framework Wiki
m (Revertidos los cambios de 190.223.51.45 (disc.) a la última edición de Joanhey)
 
(No se muestran 3 ediciones intermedias de 2 usuarios)
Línea 13: Línea 13:
 
</style>
 
</style>
  
<? echo '<div id="mimapa" class="mimapa"></div>'; ?>
+
<<div id="mimapa" class="mimapa"></div>
 
<script type="text/javascript">
 
<script type="text/javascript">
 
var mimapa;
 
var mimapa;
Línea 39: Línea 39:
 
<?php echo "<script type='text/javascript' src='http://maps.google.com/maps?file=api&;v=2&key=".$apiKey."&async=2&callback=initialize'></script>"; ?>
 
<?php echo "<script type='text/javascript' src='http://maps.google.com/maps?file=api&;v=2&key=".$apiKey."&async=2&callback=initialize'></script>"; ?>
 
</source>
 
</source>
[http://www.laughoverit.com/category/fact funny images]
 
[http://www.laughoverit.com/category/funny funny meme]
 
[http://www.laughoverit.com/category/funny-banners funny images photos]
 
[http://www.laughoverit.com/category/general funny meme]
 
[http://www.laughoverit.com/category/girl
 
[http://www.laughoverit.com/category/iphone-autocorrects funny meme]
 
[http://www.laughoverit.com/category/lol funny photo]
 
[http://www.laughoverit.com/category/stupid funny photo]
 
[http://www.laughoverit.com/category/troll funny photo]
 
[http://www.laughoverit.com/category/yahoo-question-fail funny images photos]
 
[http://www.laughoverit.com/tag/funny-meme funny photo]
 
[http://www.laughoverit.com/tag/gay funny meme]
 
[http://www.laughoverit.com/tag/sleeping funny meme]
 
[http://www.laughoverit.com/tag/funny-images funny photos]
 
[http://www.laughoverit.com/tag/iphone funny photos]
 
[http://www.laughoverit.com/tag/funny-image funny meme]
 
[http://www.laughoverit.com/tag/just-do-it funny meme]
 
[http://www.laughoverit.com/tag/ill-update-your-facebook-profile-facebook-addict funny meme]
 
[http://www.laughoverit.com/tag/facebook-status-as-dead funny photo]
 
[http://www.laughoverit.com/tag/hater funny meme]
 
[http://www.laughoverit.com/tag/racist funny pics images]
 
[http://www.laughoverit.com/tag/apple funny meme]
 
[http://www.laughoverit.com/tag/windows funny meme]
 
[http://www.laughoverit.com/tag/bill-gates funny pics images]
 
[http://www.laughoverit.com/tag/steve-jobs funny animals photos]
 
[http://www.laughoverit.com/tag/rebecca-black-sucks funny meme]
 
[http://www.laughoverit.com/tag/tiger-hares-rebecca-black funny meme]
 
[http://bloggingtalks.com how to blog]
 
[http://bloggingtalks.com/ how to blog]
 
[http://bloggingtalks.com/contact-us how to blog]
 
[http://bloggingtalks.com/wordpress-tutorials how to blog]
 
[http://bloggingtalks.com/contribute how to blog]
 
[http://bloggingtalks.com/category/blogging how to blog]
 
[http://bloggingtalks.com/category/photoshop how to blog]
 
[http://bloggingtalks.com/category/social-media how to blog]
 
[http://bloggingtalks.com/category/tutorials how to blog]
 
[http://bloggingtalks.com/category/wordpress how to blog]
 
[http://bloggingtalks.com/tons-of-traffic-but-higher-bounce-rate how to blog]
 
[http://bloggingtalks.com/author/sishir how to blog]
 
[http://bloggingtalks.com/get-rid-of-google-panda-attack how to blog]
 
[http://bloggingtalks.com/twitter-tools-strategy-that-really-works how to blog]
 
[http://bloggingtalks.com/creating-website-logo-animated-like-pro-part-2 how to blog]
 
[http://bloggingtalks.com/creating-a-website-logo-like-pro-part-1 how to blog]
 
[http://bloggingtalks.com/help-english-is-not-my-native-how-should-i-blog-to-get-success how to blog]
 
[http://bloggingtalks.com/how-to-install-wordpress-manually how to blog]
 
[http://bloggingtalks.com/the-day-when-my-blog-suspended how to blog]
 
[http://bloggingtalks.com/page/2 how to blog]
 
[http://bloggingtalks.com/page/3 how to blog]
 
[http://bloggingtalks.com/this-is-the-way-to-get-backlink-and-traffic how to blog]
 
[http://bloggingtalks.com/tag/40-free-fonts how to blog]
 
[http://bloggingtalks.com/tag/60-bounce-rate how to blog]
 
[http://bloggingtalks.com/tag/add-breadcrumbs how to blog]
 
[http://bloggingtalks.com/tag/add-breadcrumbs-in-thesis-theme how to blog]
 
[http://bloggingtalks.com/tag/backup how to blog]
 
[http://bloggingtalks.com/tag/beautiful-website how to blog]
 
[http://bloggingtalks.com/tag/birth-of-bloggingtalks-com how to blog]
 
[http://bloggingtalks.com/tag/blog-bounce-rate how to blog]
 
[http://bloggingtalks.com/tag/blogging-2 where to blog]
 
[http://bloggingtalks.com/tag/bloggingtalks-com-starts where to blog]
 
[http://bloggingtalks.com/tag/breadcrumbs where to blog]
 
[http://bloggingtalks.com/tag/breadcrumbs-for-seo where to blog]
 
[http://bloggingtalks.com/tag/creating-website-logo where to blog]
 
[http://bloggingtalks.com/tag/database where to blog]
 
[http://bloggingtalks.com/tag/decrease-bounce-rate where to blog]
 
[http://bloggingtalks.com/tag/feed where to blog]
 
[http://bloggingtalks.com/tag/feedburner where to blog]
 
[http://bloggingtalks.com/tag/feed-suscription-error where to blog]
 
[http://bloggingtalks.com/tag/fonts-new-design where to blog]
 
[http://bloggingtalks.com/tag/free-fonts where to blog]
 
[http://bloggingtalks.com/tag/free-wp-fonts where to blog]
 
[http://bloggingtalks.com/tag/ftp where to blog]
 
[http://bloggingtalks.com/tag/get-seo-friendly-navigation where to blog]
 
[http://bloggingtalks.com/tag/help-english-is-not-my-tongue-what-do-i-do where to blog]
 
[http://bloggingtalks.com/tag/how-to-create-beautiful-websites where to blog]
 
[http://bloggingtalks.com/tag/how-to-decrease-bounce-rate where to blog]
 
[http://bloggingtalks.com/tag/how-to-make-beautiful-blow where to blog]
 
[http://bloggingtalks.com/tag/how-to-secure-wordpress-blog where to blog]
 
[http://bloggingtalks.com/tag/killer-wordpress-widget-plugins where to blog]
 
[http://bloggingtalks.com/tag/make-your-blog-stand-out-from-the-crowd where to blog]
 
[http://bloggingtalks.com/tag/new-design where to blog]
 
[http://bloggingtalks.com/tag/no-plugin where to blog]
 
[http://bloggingtalks.com/tag/security where to blog]
 
[http://bloggingtalks.com/tag/ssl where to blog]
 
[http://bloggingtalks.com/tag/start-of-blogging-talks-com where to blog]
 
[http://bloggingtalks.com/tag/subscriptions where to blog]
 
[http://bloggingtalks.com/tag/thesis where to blog]
 
[http://bloggingtalks.com/tag/thesis-breadcrumbs where to blog]
 
[http://bloggingtalks.com/tag/top-widget-plugins where to blog]
 
[http://bloggingtalks.com/tag/widget-plugins where to blog]
 
[http://bloggingtalks.com/tag/wordpress-2 where to blog]
 
[http://bloggingtalks.com/tag/wordpress-customization where to blog]
 
[http://bloggingtalks.com/tag/wordpress-plugins where to blog]
 
[http://bloggingtalks.com/tag/wordpress-security-plugin where to blog]
 
[http://bloggingtalks.com/tag/wordpress-security-testwhere to blog]
 
[http://bloggingtalks.com/feed where to blog]
 
[http://bloggingtalks.com/comments/feed where to blog]
 
[http://bloggingtalks.com/how where to blog]
 
[http://bloggingtalks.com/category/blogging/feed where to blog]
 
[http://bloggingtalks.com/great-looking-ubuntu-themes blog]
 
[http://bloggingtalks.com/category/blogging/page/2 blog]
 
[http://bloggingtalks.com/category/photoshop/feed blog]
 
[http://bloggingtalks.com/new-free-fonts-you-need-to-knrow-for-your-design blog]
 
[http://bloggingtalks.com/category/social-media/feed blog]
 
[http://bloggingtalks.com/category/tutorials/feed blog]
 
[http://bloggingtalks.com/category/wordpress/feed blog]
 
[http://bloggingtalks.com/wordpress-plugin-to-highlight-code-within-a-post blog]
 
[http://bloggingtalks.com/killer-wordpress-widget-plugins blog]
 
[http://bloggingtalks.com/?author=1 blog]
 
[http://bloggingtalks.com/tons-of-traffic-but-higher-bounce-rate?replytocom=250 blog]
 
[http://bloggingtalks.com/tons-of-traffic-but-higher-bounce-rate?replytocom=251 blog]
 
[http://bloggingtalks.com/tons-of-traffic-but-higher-bounce-rate?replytocom=263 blog]
 
[http://bloggingtalks.com/tons-of-traffic-but-higher-bounce-rate?replytocom=272 blog]
 
[http://bloggingtalks.com/author/sishir/page/2 blog]
 
[http://bloggingtalks.com/author/sishir/page/3 blog]
 
[http://bloggingtalks.com/tag/fight-against-google-panda blog]
 
[http://bloggingtalks.com/tag/get-rid-of-google-panda blog]
 
[http://bloggingtalks.com/tag/google-panda-attack blog]
 
[http://bloggingtalks.com/tag/google-panda-update blog]
 
[http://bloggingtalks.com/get-rid-of-google-panda-attack?replytocom=107 blog]
 
[http://bloggingtalks.com/tag/get-instant-twitter-followers blog]
 
[http://bloggingtalks.com/tag/get-twitter-followers-fast blog]
 
[http://bloggingtalks.com/tag/twitter-followers blog]
 
[http://bloggingtalks.com/tag/twitter-strategy-that-really-works blog]
 
[http://bloggingtalks.com/tag/animated-banner blog]
 
[http://bloggingtalks.com/tag/animated-logo blog]
 
[http://bloggingtalks.com/tag/banner blog]
 
[http://bloggingtalks.com/tag/professional-looking-logo blog]
 
  
 
== Uso del Partial ==
 
== Uso del Partial ==

Revisión actual del 07:39 1 dic 2016

Colocar puntos en google maps[editar]

El partial (mapsSetPuntos.phtml) sirve para marcar varios puntos en el mapa.


Partial mapsSetPuntos.phtml[editar]

<?php $apiKey = "";?>

<style type="text/css">
.mimapa{width:500px;height:500px;}
</style>

<<div id="mimapa" class="mimapa"></div>
<script type="text/javascript">
	var mimapa;
	var gmarkers = new Array();

        function initialize(){
		if(GBrowserIsCompatible()){
                        //creamos un nuevo mapa
			mimapa = new GMap2(document.getElementById("mimapa"));
                        //establecemos cual es el centro del mapa
                        center = new GLatLng(<?php echo $centro['lat'];?>, <?php echo $centro['lng'];?>);
			mimapa.setCenter(center, <?php echo $centro['zoom'];?>);
                        //seleccionamos la interzaz del mapa
                        mimapa.setUIToDefault();

                        //por cada coordenada que se envie se crea un punto
                       <?php foreach ($puntos as $punto){?>
                           var point = new GLatLng(<?= $punto['lat']?>,<?= $punto['lng']?>);
                          mimapa.addOverlay(new GMarker(point));
                        <?php }?>
                 }
         }
</script>

<?php echo "<script type='text/javascript' src='http://maps.google.com/maps?file=api&;v=2&key=".$apiKey."&async=2&callback=initialize'></script>"; ?>

Uso del Partial[editar]

<?php $centro=array('lat'=>'-24.79', 'lng'=>'-65.41', 'zoom'=>'14');?>

<?php $puntos=array(
array('lat'=>'-24.79', 'lng'=>'-65.41'),
array('lat'=>'-24.792', 'lng'=>'-65.416'),
array('lat'=>'-24.785', 'lng'=>'-65.419')
);?>

<?php View::partial('mapsSetPuntos', false, array('centro'=>$centro,'puntos'=>$puntos)); ?>

Ademas del punto del centro también debemos pasarle las coordenadas de los puntos que queremos que aparezcan en el mapa.

Autor: @sefsinalas Fuente: http://paraisolinux.com/2-partial-utiles-de-google-maps-para-kumbiaphp/


Setpuntos-297x300.png