用标记将HTML地图代码嵌入到HTML中 [英] Embed Google Map code in HTML with marker
问题描述
例如。如果我有下面的代码,是否有可能只是放置一个选项来显示市场,因为所有的经纬度都来自数据库,并用php回显
< iframe width =425height =350frameborder =0scrolling =no
marginheight =0marginwidth =0
src =http://maps.google.mu/?ie=UTF8&ll=-20.234496,57.603722&spn=0.093419,0.169086&t=m&z= 13& amp;
output = embed>< / iframe>
< br />
< small>< a href =http://maps.google.mu/?ie=UTF8&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&ll=-20.234496,57.603722&spn=0.093419,0.169086&t=m&z=13&
output=embed"></iframe>
<br />
<small><a href="http://maps.google.mu/?ie=UTF8&ll=-20.234496,57.603722
&spn=0.093419,0.169086&t=m&z=13&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屋!