开发者

cloudmade - draggable marker + collecting the marker coordinates to be stored or used in the application

开发者 https://www.devze.com 2023-02-12 14:21 出处:网络
I would like to use CloudMade mapping in one of my projects. I need to be able to create a draggable marker so users can mark a certain geographic space on the map. I would also like to be able to sav

I would like to use CloudMade mapping in one of my projects. I need to be able to create a draggable marker so users can mark a certain geographic space on the map. I would also like to be able to save the coordinates of th开发者_如何学JAVAe marker in a database. Is that possible with CloudMade and how?


var centreIcon = new CM.Icon();
   centreIcon.image = "/images/marker_cross.png";
   centreIcon.iconSize = new CM.Size(15, 15);
   centreIcon.iconAnchor = new CM.Point(7.5, 7.5);

   newLocation = new CM.LatLng(gpsLat2, gpsLng2);
   centreMarker = new CM.Marker(newLocation,
   {
      title : "Centre", icon : centreIcon, draggable : true
   }
   );
   map.addOverlay(centreMarker);
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号