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

StackOverflow https://stackoverflow.com/questions/5086422

  •  04-12-2019
  •  | 
  •  

Question

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 the marker in a database. Is that possible with CloudMade and how?

Was it helpful?

Solution

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);
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top