none
Saving pushpins to public map RRS feed

  • Question

  • Hello!

    I've recently embedded my bing map to my website, and went through the tutorial on how to add pushpins said map. I was wondering though - how do i save these pushpins people add to the map? I noticed when i refresh the page the pins disappear.

    Thanks!

    Here's what i have so far: (using Microsoft's tutorial)

    function GetMap()
    {
        var mapOptions = {
             credentials: "MYKEY",
             center: new Microsoft.Maps.Location(37.901164, -122.502264),
             mapTypeId: Microsoft.Maps.MapTypeId.road,
             zoom: 9,
             showScalebar: false
             }
      // Initialize the map
      map = new Microsoft.Maps.Map(document.getElementById("myMap"), mapOptions),
                   ({credentials:"MYKEY"});

      // Add a handler for the map click event.
      Microsoft.Maps.Events.addHandler(map, 'dblclick', addPin);


    }

    function addPin(e) {
        if (e.targetType == "map") {
            var point = new Microsoft.Maps.Point(e.getX(), e.getY());
            var loc = e.target.tryPixelToLocation(point);
            var pin = new Microsoft.Maps.Pushpin(loc);

            map.entities.push(pin);
        }
    }

    Monday, November 24, 2014 4:23 AM

Answers

All replies