Gmap3 - Forum

Gmap3 exchange platform

You are not logged in.

Ads
(server costs 27.50€ per month)

#1 2012-05-27 07:54:16

louiszoom
Member
Registered: 2012-05-27
Posts: 2

how to addnewmakers by current.latLng

menu.add('添加标记点', 'addMarkerss', 
          function(){
			  $map.gmap3({
			 action:'addMarker',
            latLng:current.latLng,
            options:{draggable:true,
              icon:new google.maps.MarkerImage('/image/m3.png')},
			  
			 });
              
              menu.close();
			
          });

IT COULD NOT WORK
======================
I WANNA TO ADD LIGHT MENU FOR ADDMARKERS AND CAN IMPORT THE current LAT LNG TO TEXTBOX.

Offline

Ads
(server costs 27.50€ per month)

#2 2012-05-29 07:38:59

rqx110
Member
Registered: 2012-04-26
Posts: 12

Re: how to addnewmakers by current.latLng

你的重点是怎么获取到当前坐标,而不是怎么添加。

Offline

#3 2012-05-30 09:13:02

louiszoom
Member
Registered: 2012-05-27
Posts: 2

Re: how to addnewmakers by current.latLng

function(){
			  $map.gmap3({
			 action: 'addMarkers',
            markers:[
              
			  {latLng:current.latLng, data:'新建标记点,坐标北纬、东经:'+current.latLng},
			  
            ],
            marker:{
              options:{
                draggable: false
              },
              events:{
                mouseover: function(marker, event, data){
                  var map = $(this).gmap3('get'),
                      infowindow = $(this).gmap3({action:'get', name:'infowindow'});
                  if (infowindow){
                    infowindow.open(map, marker);
                    infowindow.setContent(data);
                  } else {
                    $(this).gmap3({action:'addinfowindow', anchor:marker, options:{content: data}});
                  }
                },
                mouseout: function(){
                  var infowindow = $(this).gmap3({action:'get', name:'infowindow'});
                  if (infowindow){
                    infowindow.close();
                  }
                }
              }
            }
			 
       
			  
			 });
              
              menu.close();
			
          });

do it

Last edited by louiszoom (2012-05-30 09:13:54)

Offline

Board footer

Powered by FluxBB