I have this code and i want the add a x and y coordinate locator so you can add a pushpin at that point.
Also how do you have pushpins. I saw some of the samples on this website, but what code do you add a pushpin. How do you make it popup.
I have seen a x y coordinate locator in one sample, and a pushpin in another. I want to combine it to this code:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/> <meta http-equiv="X-UA-Compatible" content="IE=7,IE=9" /> <!--The viewport meta tag is used to improve the presentation and behavior of the samples on iOS devices--> <meta name="viewport" content="initial-scale=1, maximum-scale=1,user-scalable=no"/> <title>Display Multiple ArcGIS Online Services</title> <link rel="stylesheet" type="text/css" href="http://serverapi.arcgisonline.com/jsapi/arcgis/2.8/js/dojo/dijit/themes/claro/claro.css">
function init() { var initExtent = new esri.geometry.Extent({"xmin":-14628212,"ymin":714227,"xmax":7718305,"ymax":9832858,"spatialReference":{"wkid":102100}}); map = new esri.Map("map",{extent:initExtent}); basemapGallery = new esri.dijit.BasemapGallery({ showArcGISBasemaps: true, map: map }); dojo.connect(basemapGallery,"onLoad",function(){ dojo.forEach(basemapGallery.basemaps, function(basemap) { //Add a menu item for each basemap, when the menu items are selected dijit.byId("basemapMenu").addChild(new dijit.MenuItem({ label: basemap.title, onClick: dojo.hitch(this, function() { this.basemapGallery.select(basemap.id); }) })); }); }); dojo.connect(map, 'onLoad', function(theMap) { //resize the map when the browser resizes dojo.connect(dijit.byId('map'), 'resize', map,map.resize); }); } dojo.addOnLoad(init);
</script>
</head> <body class="claro"> <div dojotype="dijit.layout.BorderContainer" design="headline" gutters="false" style="width: 100%; height: 100%;"> <div id="map" dojotype="dijit.layout.ContentPane" region="center"> <div style="position:absolute; right:50px; top:10px; z-Index:99;"> <button id="dropdownButton" label="Basemaps" dojoType="dijit.form.DropDownButton"> <div dojoType="dijit.Menu" id="basemapMenu"> <!--The menu items are dynamically created from basemaps--> </div> </button> </div> </div>
var map; function init() { var initExtent = new esri.geometry.Extent({"xmin":-13114922,"ymin":-5500000,"xmax":9292585,"ymax":10351408, "spatialReference":{"wkid":102100}}); map = new esri.Map("map",{extent:initExtent}); var basemap = new esri.layers.ArcGISTiledMapServiceLayer("http://server.arcgisonline.com/ArcGIS/rest/services/World_Topo_Map/MapServer"); map.addLayer(basemap);
dojo.connect(map, "onLoad", function() {
var points = { "points": [[-122.63,45.51],[-122.56,45.51],[-122.56,45.55],[-122.62,45.00],[77,19]], "spatialReference": ({ "wkid": 4326 }) }; var mp = new esri.geometry.Multipoint(points); var wm_mp = esri.geometry.geographicToWebMercator(mp);
var sms = new esri.symbol.SimpleMarkerSymbol(); var infoTemplate = new esri.InfoTemplate("Bob","Lives in the USA"); var graphic = new esri.Graphic(wm_mp, sms, '', infoTemplate); map.graphics.add(graphic);
dojo.connect(map.graphics, "onMouseOver", function(evt) { var g = evt.graphic; map.infoWindow.setContent(g.getContent()); map.infoWindow.setTitle(g.getTitle()); map.infoWindow.show(evt.screenPoint,map.getInfoWindowAnchor(evt.screenPoint));