|
POST
|
Customizing this Esri Sample I am able to get Lat and Long of new added Point to the Map at function addToMap(evt) {
var symbol;
toolbar.deactivate();
map.showZoomSlider();
switch (evt.geometry.type) {
case "point":
symbol = new SimpleMarkerSymbol();
var mp = webMercatorUtils.webMercatorToGeographic(evt.geometry);
var lat = mp.x;
var long = mp.y;
console.log(lat, long);
var point = new Point(lat, long);
var graphic = new Graphic(point, symbol);
pointGraphicLayer.add(graphic);
break; Now I need to do the same process for Multipoint class as case "multipoint":
symbol = new SimpleMarkerSymbol();
var mp = webMercatorUtils.webMercatorToGeographic(evt.geometry);
console.log(mp.points); but I am getting this error can you please let me know how I can get a list of lat and long of multi point? Thanks Update I also tried this case "multipoint":
symbol = new SimpleMarkerSymbol();
console.log(this.points);
break; but the console.log() is not printing out any thing however I am not getting error neither
... View more
01-17-2017
03:18 PM
|
0
|
3
|
1995
|
|
POST
|
Did you check the value of the fullExtent property? Thanks for reply Robert but how can I check this? if this is about schoolGraphicLayer I am sure that I have many graphics there already!
... View more
01-17-2017
02:48 PM
|
0
|
10
|
3024
|
|
POST
|
Hi Robert did you have a chance to take a look at this issue? Thanks
... View more
01-17-2017
02:11 PM
|
0
|
12
|
3024
|
|
POST
|
Thanks just one more question, How about Draw toolbar? is that also a helper Class or has to come with UI?
... View more
01-17-2017
11:15 AM
|
0
|
1
|
2130
|
|
POST
|
well I would like to use my own custom UI (in front end) but using the Draw and Edit toolbar I have to add and use all UI from the ESRI, am I right?
... View more
01-17-2017
11:07 AM
|
0
|
0
|
2130
|
|
POST
|
Thanks Andrew, As I mentioned already I am not willing to use the Toolbar (Edit or Draw) so can you please let me know how I can do this without using the toolbar? I also updated the code to var schoolMarker = new SimpleMarkerSymbol();
schoolMarker.setStyle(SimpleMarkerSymbol.STYLE_CIRCLE);
schoolMarker.setSize(8);
schoolMarker.setOutline(null);
schoolMarker.setColor(new Color([156, 255, 0, 1]));
var schoolGraphicLayer = new GraphicsLayer();
schoolGraphicLayer.id = 'SchoolGLayer';
map.addLayer(schoolGraphicLayer);
map.on("click", addGraphic);
function addGraphic(evt) {
var mp = webMercatorUtils.webMercatorToGeographic(evt.mapPoint);
var lat = mp.x;
var long = mp.y;
console.log(lat, long);
var point = new Point(lat, long);
var graphic = new Graphic(point, schoolMarker);
schoolGraphicLayer.add(graphic);
} and now I am able to get the lat and long values but still not sure how to make them editable?
... View more
01-17-2017
10:54 AM
|
0
|
5
|
2130
|
|
POST
|
Using ArcGIS JavaScript 3.19 I am trying to create my own tool instead of using ArcGIS Toolbar. I am able to add some graphics (point) on the map using this code var schoolMarker = new SimpleMarkerSymbol();
schoolMarker.setStyle(SimpleMarkerSymbol.STYLE_CIRCLE);
schoolMarker.setSize(8);
schoolMarker.setOutline(null);
schoolMarker.setColor(new Color([156, 255, 0, 1]));
var schoolGraphicLayer = new GraphicsLayer();
schoolGraphicLayer.id = 'SchoolGLayer';
map.addLayer(schoolGraphicLayer);
map.on("click", addGraphic);
function addGraphic(evt) {
var schoolMarker = new SimpleMarkerSymbol();
var graphic = new Graphic(evt.mapPoint, schoolMarker);
schoolGraphicLayer.add(graphic)
} now what I need is to Make the Points Editable(Moveable) Can you please let me know how to fix this? Thanks
... View more
01-17-2017
10:17 AM
|
0
|
7
|
2772
|
|
POST
|
Thanks again Robert I tried this way as the `schoolGraphicLayer` is my graphic layer added to the Map already $("#show-all-schools").on("click", function () {
map.setExtent(schoolGraphicLayer);
}); but nothing is happening! Can you please let me know what I am doing wrong?
... View more
01-13-2017
03:41 PM
|
0
|
15
|
3024
|
|
POST
|
Using ArcGIS JavaScript API 3.19, I am simply adding some Point Graphics From a JSON object (Schools) like below var data = [{
"SCHOOL_NAME": "King George Sec.",
"LATITUDE": 49.2898,
"LONGITUDE": -123.1364,
"ADDRESS": "1755 Barclay St",
"URLLINK": "http://www.vsb.bc.ca/schools/king-george"
}, {
"SCHOOL_NAME": "Britannia Sec.",
"LATITUDE": 49.2752,
"LONGITUDE": -123.0719,
"ADDRESS": "1001 Cotton Drive",
"URLLINK": "http://www.vsb.bc.ca/schools/britannia-secondary"
}, {
"SCHOOL_NAME": "Magee Sec.",
"LATITUDE": 49.2286,
"LONGITUDE": -123.1515,
"ADDRESS": "6360 Maple St",
"URLLINK": "http://www.vsb.bc.ca/schools/magee"
},
....]; to the map. now I would like to add a functionality to Zoom to Full Extent of ONLY school points on the Map. Technically I add the `Navigation` class to the Map require(["esri/toolbars/navigation"], function(Navigation) { /* code goes here */ }); and in HTML I have a simple button <button id="show-all-schools">Show All Schools</button> and in JS I have $("#show-all-schools").on("click", function () {
navToolbar = new Navigation(map);
navToolbar.zoomToFullExtent();
});
but this is setting the basemap in Full Extent state! Can you please let me know how to pass a parameter like points to zoom to cover entire points instead of basemap? Thanks
... View more
01-13-2017
02:54 PM
|
0
|
17
|
6671
|
|
POST
|
I Tried this and it is working, but not sure if it is the best way to do? var location = new Point(zoomLong,zoomLat);
map.centerAndZoom(location,16); can you please let me know if there is a better way to do this?
... View more
01-13-2017
01:50 PM
|
0
|
0
|
3960
|
|
POST
|
Thanks Robert, so how can I pass the var zoomLat = 49.2898
var zoomLong = -123.1364; to location in : map.centerAndZoom(location,12); Thanks again
... View more
01-13-2017
01:45 PM
|
0
|
2
|
3960
|
|
POST
|
Can you please let me know how we can enable ArcGIS JavaScript API to use custom ZoomIn function? For example let's say I have a code Like <button id="zoom-to-point" > Zoom To </button> and in Js Part $("#zoom-to-point").on('click', function(){
var zoomLat = 49.2898
var zoomLong = -123.1364;
map.zoomTo(zoomLat,zoomLong );
}); As you know we have not such a .zoomTo function in API so can you please let me know how can I get it done?
... View more
01-13-2017
11:51 AM
|
0
|
7
|
7681
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | 07-25-2017 08:32 AM | |
| 1 | 07-04-2017 01:47 PM | |
| 1 | 08-15-2017 02:44 PM | |
| 1 | 05-19-2017 02:36 PM | |
| 1 | 02-09-2017 12:37 PM |
| Online Status |
Offline
|
| Date Last Visited |
12-31-2020
08:22 PM
|