自定义YM4R谷歌地图标记
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了自定义YM4R谷歌地图标记相关的知识,希望对你有一定的参考价值。
map = GMap.new( Constants::GM_DIV_ID, Constants::GM_NAME ) # Define the start and end icons map.icon_global_init( GIcon.new( :image => "/images/google_maps/icong.png", :icon_size => GSize.new( 24,38 ), :icon_anchor => GPoint.new(12,38), :info_window_anchor => GPoint.new(9,2) ), "icon_start") map.icon_global_init( GIcon.new( :image => "/images/google_maps/iconr.png", :icon_size => GSize.new( 24,38 ), :icon_anchor => GPoint.new(12,38), :info_window_anchor => GPoint.new(9,2) ), "icon_stop" ) icon_start = Variable.new("icon_start"); icon_stop = Variable.new("icon_stop") if respond_to?( "start_lat" ) && respond_to?( "start_long" ) map.center_zoom_init( [start_lat, start_long], Constants::GM_ZOOM ) map.overlay_init( GMarker.new( [start_lat, start_long], { :icon => icon_start, :title => name + " start", :info_window => "start" } ) ) end if respond_to?( "end_lat" ) && respond_to?( "end_long" ) map.overlay_init( GMarker.new( [end_lat, end_long], { :icon => icon_stop, :title => name + " end", :info_window => "end" } ) ) end
以上是关于自定义YM4R谷歌地图标记的主要内容,如果未能解决你的问题,请参考以下文章