POST
|
I'm trying to fix some bugs with the ClusterLayer example and I'm having a little bit of trouble understanding the capabilities of InfoWindow. If you go to the ClusterLayer example (link below) and click on one of the clustered points (try the one with "3" nearer the top). When the InfoWindow shows up, you're able to do 1 of 2 things... (1) navigate through the clustered points using the left/right arrows atop the InfoWindow (I'm assuming this is built in), or (2) actually click on the individual points. http://developers.arcgis.com/en/javascript/samples/layers_point_clustering/ It works perfectly fine if you just use the left/right arrows with your mouse -- you'll see the content of the InfoWindow change, and the points will be highlighted with a light-blue reticle/crosshair. The problem is when you try to click on the individual points of interest: the reticle/crosshair never moves away from the first item you lose the "(1 of 3)" text from the title of the InfoWindow now that the info window has jumped to the location of the point you've clicked on, it feels like it should move when you navigate left/right... or perhaps just stay anchored to the cluster Is the InfoWindow capable of handling all of this? Maybe it's not meant to handle different points on the map? The code uses a method on InfoWindow called "setFeature", but I can't find any documentation on it in the API. As best I can tell, it's partially responsible for setting the InfoWindow's content, and fully responsible for setting up the left/right navigation. I said "partially" before, because the InfoWindow.show() method also displays the InfoWindow's content, but since the cluster point has no content, it doesn't actually do anything... but InfoWindow.show() DOES do something those times when you click on a single point within the cluster... All that said, am I better off just rolling my own InfoWindow if I want all of this functionality, or is it something InfoWindow should be able to handle?
... View more
05-13-2013
12:40 PM
|
0
|
0
|
515
|
POST
|
I tried calling TextSymbol::setText('xxx') after my text symbol was rendered on the map, but it doesn't seem to update. Is there a way to change an already-rendered TextSymbol's text without removing/re-adding it to the map? Thanks!
... View more
05-08-2013
11:46 AM
|
0
|
1
|
520
|
POST
|
http://plnkr.co/edit/a2nKNFWQM0R7U8BOvJnl?p=preview I've got it only updating the cluster points that are relevant now, but the lag when the marker is redrawn really stinks. Hopefully someone can answer my questions above re:TextSymbol.setText/Point.update and point me in the right direction. I had tot get rid of the ClassBreaksRenderer, because I wasn't sure how to get it to update when a marker moved. It looks like the original code was trying to get it to update, but it didn't work post-render (referring to _updateClusterGeometry()). Also, the graphic is being requested from the server each time the layer is rendered. Is there a way to cache this? I tried storing the instance of PictureMarkerSymbol locally, but that didn't work. PS: The code is really nasty (lots of copy/paste). I plan on cleaning it up before actually using it, so at some point I'll reply with a cleaned up ClusterLayer.js.
... View more
04-26-2013
07:27 AM
|
0
|
0
|
235
|
POST
|
I've dug into this a little deeper, and I'm still having to remove/re-add cluster layers that are affected by points being added/removed from them. I assume this is by design and that TextSymbol::setText() is just setting the text on the object, and not updating the map? And same for Point::update()?
... View more
04-26-2013
05:38 AM
|
0
|
0
|
235
|
POST
|
In looking at the ClusterLayer example and reading the forums, I gather that it was strictly written to handle a single chunk of static data. However, in playing around with it, it seems that it is partially capable of handling dynamic data: 1. Preview this: http://plnkr.co/edit/NnWEBtpzllEZmwngSkX9?p=preview 2. Zoom out a few levels when you can and see how the existing clusters change 3. Also see the console ("didn't find exactly one LABEL: []") So it seems that: 1. If there's an existing cluster available, the point will be added to it 2. If no suitable cluster exists, and no interfering point has been created, one will be created 3. If an interfering point exists (and there's no existing cluster) it throws that error about ("didn't find exactly one LABEL: []"); I made some super simple modifications to get dynamic adding/removing/clearing of points here: - http://plnkr.co/edit/a2nKNFWQM0R7U8BOvJnl?p=preview (overwritten with new changes) But having to redraw the points each time an add/remove/clear action occurs isn't optimal. Has anyone spent some time tweaking ClusterLayers to get this kind of functionality without the redraw effect? I'm going to attempt to do it, but I'd rather save myself the pain if someone else has already done so. TIA!
... View more
04-25-2013
11:44 AM
|
0
|
2
|
825
|
POST
|
Ahh OK. I might try that or strip out the base map switching feature and use it as a carrot to maybe get a new version pushed through. I'm sure I'll run up against other nice features and bug fixes that 3.2 offers over 2.6. Thanks for your assistance!
... View more
11-16-2012
11:43 AM
|
0
|
0
|
486
|
POST
|
Ahh, dang, I guess that's it. https://www.dpchallenge.com/testmaps.html https://www.dpchallenge.com/testmaps32.html Any known work arounds for 2.6? I'm stuck using it as this will be deployed to an network environment where only 2.6 exists.
... View more
11-16-2012
11:11 AM
|
0
|
0
|
486
|
POST
|
Do you happen to have an example of that? This configuration isn't working for me: <!DOCTYPE html>
<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"/>
</head>
<body class="claro">
<div id="mapContainer" data-iconSet="Modern">
<div id="map" dojotype="dijit.layout.ContentPane" region="center" style="height: 950px;">
<div id="mapSelector">
<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>
</div>
</body>
<script type="text/javascript">var djConfig = { 'parseOnLoad': true };</script>
<script type="text/javascript" src="https://serverapi.arcgisonline.com/jsapi/arcgis/?v=2.6"></script>
<script type="text/javascript">
// setup arcgis
dojo.require('esri.map');
dojo.require('dijit.form.Button');
dojo.require('dijit.layout.BorderContainer');
dojo.require('dijit.layout.ContentPane');
dojo.require('esri.dijit.BasemapGallery');
dojo.require('dijit.form.Button');
dojo.require('dijit.Menu');
var basemapGallery,
_map;
dojo.addOnLoad(function () {
var initExtent = new esri.geometry.Extent({"xmin":-122.46,"ymin":37.73,"xmax":-122.36,"ymax":37.77,"spatialReference":{"wkid":4326}});
_map = new esri.Map("map",{
extent:esri.geometry.geographicToWebMercator(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 () {
basemapGallery.select(basemap.id);
})
}));
});
});
dojo.connect(_map, 'onLoad', function () {
//resize the map when the browser resizes
dojo.connect(dijit.byId('map'), 'resize', _map, _map.resize);
});
});
</script>
</html> In Chrome I get: [blocked] The page at https://xxx/test2.html ran insecure content from http://www.arcgis.com/sharing/community/groups?q=title%3A%22ArcGIS%20Online%20Basemaps%22%20AND%20owner%3Aesri&f=json&callback=dojo.io.script.jsonp_dojoIoScript1._jsonpCallback.
... View more
11-16-2012
09:50 AM
|
0
|
0
|
486
|
POST
|
OK, I see. For baseMaps, I was doing: basemapGallery = new esri.dijit.BasemapGallery({
showArcGISBasemaps: true,
map: _map
}); Which I grabbed some an example somewhere. This `new baseMapGallery()` gives me http instead of https everywhere. Thanks for the reply!
... View more
11-16-2012
09:26 AM
|
0
|
0
|
486
|
POST
|
All the samples are using standard HTTP, but I figured using SSL would be as simple as adding an "s" to: <script type="text/javascript" src="http://serverapi.arcgisonline.com/jsapi/arcgis/?v=2.6"></script> And while it more or less was, I did have to apply the hack below: esri.setRequestPreCallback(function (ioArgs) {
alert(ioArgs.url);
ioArgs.url = ioArgs.url.replace('http:', 'https:');
return ioArgs;
}); Unfortunately even with that, all of the map images are being loaded over non-SSL. Is there a proper way to using ArcGIS over SSL? Some property I need to set somewhere? TIA!
... View more
11-16-2012
08:38 AM
|
0
|
8
|
1089
|
Online Status |
Offline
|
Date Last Visited |
11-11-2020
02:24 AM
|