用标记将HTML地图代码嵌入到HTML中 [英] Embed Google Map code in HTML with marker

查看:128
本文介绍了用标记将HTML地图代码嵌入到HTML中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有几个地方有他们的经度和纬度。我想在谷歌地图中显示它们。没关系,我不能在特定的拉特,多头位置显示标记。



例如。如果我有下面的代码,是否有可能只是放置一个选项来显示市场,因为所有的经纬度都来自数据库,并用php回显

 < iframe width =425height =350frameborder =0scrolling =no
marginheight =0marginwidth =0
src =http://maps.google.mu/?ie=UTF8&amp;ll=-20.234496,57.603722&amp;spn=0.093419,0.169086&amp;t=m&amp;z= 13& amp;
output = embed>< / iframe>
< br />
< small>< a href =http://maps.google.mu/?ie=UTF8&amp;ll=-20.234496,57.603722
& amp; amp; spn = 0.093419,0.169086 & amp; t = m& amp; amp; amp; amp; amp; amp; amp; amp; amp; amp; amp; amp; amp; amp; amp; amp; amp; amp; amp; amp; amp; amp; amp; 13;& amp; amp; amp; amp; amp; amp; amp; amp;一个>
< / small>


解决方案

您发布的元素看起来像只是copy-从谷歌地图嵌入功能粘贴。



如果您想删除已有位置的标记,则需要编写一些JavaScript来执行此操作。



查看以下内容:
https://developers.google.com/maps/documentation/javascript/overlays



它有几个例子和代码样本,可以很容易地重新使用和适应您的当前问题。


I have several places with their latitude and longitude. I want to display them in google map. Thats ok, what i can't is to display the marker at the specific lat,long position.

e.g. if i've the following code, is it possible just to place an option to display the market as well because all the lat,long coord are comming from a database and echoed with php

<iframe width="425" height="350" frameborder="0" scrolling="no" 
        marginheight="0" marginwidth="0" 
        src="http://maps.google.mu/?ie=UTF8&amp;ll=-20.234496,57.603722&amp;spn=0.093419,0.169086&amp;t=m&amp;z=13&amp;
        output=embed"></iframe>
        <br />
        <small><a href="http://maps.google.mu/?ie=UTF8&amp;ll=-20.234496,57.603722
                  &amp;spn=0.093419,0.169086&amp;t=m&amp;z=13&amp;source=embed"
               style="color:#0000FF;text-align:left">View Larger Map
               </a>
        </small>

解决方案

The element that you posted looks like it's just copy-pasted from the Google Maps embed feature.

If you'd like to drop markers for the locations that you have, you'll need to write some JavaScript to do so. I'm learning how to do this as well.

Check out the following: https://developers.google.com/maps/documentation/javascript/overlays

It has several examples and code samples that can be easily re-used and adapted to fit your current problem.

这篇关于用标记将HTML地图代码嵌入到HTML中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆