|
POST
|
Riyas Deen I marked the line example as the correct answer since I don't think you can mark two posts as the correct answer. Your line ripple example is a much smoother animation than what I originally came up with and I've already incorporated it into my project so thank you for that! The example for points is beautiful- this is exactly what I mentally envisioned for the animation. While your example works, there is a small glitch with your approach but I don't know the answer for fixing it. It seems to be built on screen coordinates so zooming the map or, more severely, panning the map breaks the location of the animation. A map zoom will correct itself but if you simply pan the map, the animation stays at its original screen location even though the point has moved elsewhere. I can see what you did there but I don't quite understand the why.
... View more
08-26-2014
02:29 PM
|
0
|
1
|
4820
|
|
POST
|
Thanks for that tip, Robert. Just another thing to love about GeoNet!
... View more
08-26-2014
11:54 AM
|
0
|
0
|
4820
|
|
POST
|
Hi Riyas, I don't see an attachment or link in your reply.
... View more
08-26-2014
11:01 AM
|
0
|
2
|
4820
|
|
POST
|
A question for the ESRI Dev folks or anyone else who have spent time on this topic- I'm working on adding some animations to the selected feature when a user clicks on a feature using the technique in this ESRI sample. Unlike the sample, I'm tapping into the graphic-draw event of the map's graphic layer. It does work- and here's a JSFiddle that shows it in action. I'll call this my "pulse" animation. What I have in the JSFiddle, however, is actually my second choice of "animation". I originally wanted to incorporate this animation into my project but it does not animate (here's my modified Fiddle of the original to show what I wanted the animation to do). I know the "hook" into the event in my JS code is sound because my "pulse" animation linked in my Fiddle works (and also works in my actual project). I wanted to use a different animation style for linear features (as shown on #5 on this page) but it does not animate. I guess my question is this- is there some part of the JS API that prevents some of these animations from operating? A CSS conflict between my CSS and the API's? I can't see it but that doesn't mean it exists. Thanks! Steve [EDIT: I should clarify some things- I've mostly been developing in Chrome with some double checking in Firefox.I do know that IE doesn't support animations natively. I did get the line animation to work in Firefox but it does not animate in Chrome.]
... View more
08-25-2014
02:28 PM
|
1
|
7
|
8953
|
|
POST
|
This will be (Legacy) pseudo-code but essentially, create a barebones web map (something like an ESRI sample) and, in the map init function, perform a query for your parcel and then zoom to the result it returns. Here's something similar I did for a web map that would zoom into the location of a feature if a lat/long coordinate pair was passed as part of the URL:
//Evaluate the URL of this HTML page to determine if any parameters were passed with it
var htmlPagePath = window.location.toString();
var qLocation = htmlPagePath.indexOf('?');
if (qLocation < 1)
{
passedLatLong = false;
}
else
passLatLong = true;
//If a coordinate location was passed as a parameter, zoom the map to it
if (passedLatLong)
{
//Extract the lat/long coordinates passed as a parameter with the URL
var coordStr = window.location.toString().substr(qLocation + 1,window.location.toString().length);
var coords = new Array();
coords = coordStr.split(',');
//Create a lat/long point
var bridgeLoc = new esri.geometry.Point(coords[0],coords[1], new esri.SpatialReference({wkid:4326}));
//set the map extent based on the lat/long coordinate passed. The coordinate must be converted
//to Web Mercator since the web services used have been defined with that projection..
map.setExtent(pointToExtent(map,esri.geometry.geographicToWebMercator(bridgeLoc),3));
}
Obviously, in your case, you would perform a queryTask on your parcels using the supplied parcel ID and then zoom to the result.
... View more
08-12-2014
08:02 AM
|
0
|
0
|
1317
|
|
POST
|
Thanks for the modified sample, Robert. I've marked it as answered I spent the day re-working my code to fit the logic from your sample and it does eliminate the click issue that originally prompted my post. The setTimeout of 500 is too much of a pause while clicking around the map. I was actually able to reduce that value to as little as 5 and the functionality still works as designed and is more responsive. Unfortunately for me, the re-work of the coding has broken some other aspect of my slide out panel functionality but that's a JavaScript issue and not an API issue.
... View more
08-11-2014
09:53 PM
|
0
|
0
|
617
|
|
POST
|
A sad day for us end users but Derek tweeted this brief blurb out this morning via Twitter so I just want to take a moment here to thank him for his assistance on the forums and for his work bringing the JavaScript API to where it is today. You will definitely be missed here in the JavaScript API forums! Best of luck to you. Steve
... View more
08-11-2014
09:56 AM
|
0
|
0
|
1001
|
|
POST
|
That's pretty nice, Robert. I do like your different solution. Hmm.. As for why I used the click event of the featureLayer, it all boils down to what I originally learned and the comfort & familiarity of that. For the infoWindows I've worked with, I've always had to tweak & reformat the content going to the infoWindow and your solution (along with the original ESRI sample) just pumps the info automatically into the infoWindow. I just had difficulty determining how to inject myself in that process. With the click event, I already know how to do that so I just went with it. I really do like your solution since it eliminates the issue I can't otherwise get rid of. I'll have to chew on that. Thanks, Robert. I appreciate all the help on this! Steve
... View more
08-11-2014
08:07 AM
|
0
|
2
|
617
|
|
POST
|
Thanks, Robert. That totally makes sense; it just appears that this is not user adjustable.
... View more
08-11-2014
07:53 AM
|
0
|
5
|
2990
|
|
POST
|
In the app I'm developing, I'm using featureLayer.on("click",...) to control when the infoWindow content is displayed. What I've noticed is that I can click and select a feature in the layer without triggering that click event. The end result is that my infoWindow information does not appear. To illustrate this, I have taken one of the ESRI samples and made a Fiddle of it: My Sample In the sample (and my app in development), I am using featureLayer.on("mouse-enter",...) to change the mouse icon to a pointer to indicate to the user that the feature can be clicked. What I'm noticing is that if the mouse is close to the feature but not truly "over it", you can click and select it due to some mystical tolerance. That's fine for ESRI's sample but, in my app, that means that my infoWindow content doesn't get displayed. What I need is consistency: if the mouse icon does not change to a pointer (i.e. the mouse is actually over the feature), then a click should NOT select the feature. How can I accomplish this? I couldn't find a reference to a tolerance with the exception of IdentifyTask. Thanks! Steve
... View more
08-08-2014
03:38 PM
|
0
|
8
|
6421
|
|
POST
|
Ok, now that I can finally post code correctly, lemme reply. The best I can do since it's not public facing at this time is post all the relevant code so here goes.. Starting here:
//Set the infoWindow to not display since the content is going to the slideout panel
map.infoWindow.set("popupWindow", false);
The click event for one of the featureLayers:
tipLines.on("click", function(evt) {
if($("#tipPointPanel").is(":visible") ) {
$("#tipPointPanel").hide();
}
attrib = evt.graphic.attributes;
document.getElementById("lnTipType").innerHTML = getTipCatType(attrib.tipType);
document.getElementById("lnPrjName").innerHTML = attrib.prjName;
document.getElementById("lnPrjStart").innerHTML = attrib.prjStart;
document.getElementById("lnPrjEnd").innerHTML = attrib.prjEnd;
document.getElementById("lnCouncilDist").innerHTML = attrib.councilDist;
document.getElementById("lnOnAcp").innerHTML = attrib.onACP;
document.getElementById("lnImpType").innerHTML = getImprovementType(attrib.impType);
document.getElementById("lnPrjDesc").innerHTML = attrib.prjDescr;
document.getElementById("lnPrjPhase").innerHTML = attrib.prjPhase;
document.getElementById("lnTipID").innerHTML = attrib.TIPID;
if(attrib.prjURL == null) {
$("#showLnPrjLink").css("display","none");
$("#hideLnPrjLink").css("display","inherit");
$("#lnPrjUrlLink").prop("href", "javascript:void(0)");
} else {
$("#showLnPrjLink").css("display","inherit");
$("#hideLnPrjLink").css("display","none");
$("#lnPrjUrlLink").prop("href", attrib.prjURL + "/#structuralContainer12");
}
curColors = getTipCatColor(attrib.tipType);
document.getElementById("lnTipTypeBackground").style.background = curColors[0].toString();
document.getElementById("lnTipTypeBackground").style.color = curColors[1].toString();
$("#tipLinePanel").animate({ "width": "25%", "display": "inline" }, "fast" );
});
Here's where I'm trying to respond to a few situations where the panel should close:
//when the selection is cleared remove the popup content from the side panel.
connect.connect(tipLines, "onSelectionClear", function(){
$("#tipLinePanel").animate({ "width": "0%"}, "fast", "swing", function() {$("#tipLinePanel").hide();} );
});
connect.connect(tipLines, "onSelectionComplete", function (features,selMethod) {
if (features.length == 0) {
$("#tipLinePanel").animate({ "width": "0%"}, "fast", "swing", function() {$("#tipLinePanel").hide();} );
}
});
Finally, that brings me to my original post and my attempts to respond to a mouse click elsewhere on the map which unselects a feature and should close my panel:
map.on("click", function() {
console.log("debugging!");
if(map.graphics.graphics.length == 0) {
if($("#tipLinePanel").is(":visible") ) {
$("#tipLinePanel").hide();
}
if($("#tipPointPanel").is(":visible") ) {
$("#tipPointPanel").hide();
}
}
});
That's all the code as it relates to interacting with the featureLayer that populates a side panel.
... View more
08-08-2014
01:02 PM
|
0
|
1
|
3127
|
|
POST
|
No- that doesn't work. It actually prevents the panel from opening by hiding it prematurely. [side note- I REALLY hate these new forums. Why is it so friggin hard to paste in JS code? Argh]
... View more
08-08-2014
11:42 AM
|
0
|
3
|
3127
|
|
POST
|
Thanks for the reply, Robert. My app is loosely based on the sample. I moved away from some of the logic in the sampel and the actual display of the panels in my app are handled by the traditional click event on the relevant featureLayers: theFeatureLayer.on("click",function(evt) { ...... }); I just went back to the sample and tried incorporating the "onClearFeatures" event based on the popup but now the panel won't open because this event is triggered during the course of selecting a feature. Basically, it gets closed as it's supposed to open. That's a no-go as well..
... View more
08-08-2014
11:09 AM
|
0
|
5
|
3127
|
|
POST
|
I'm currently developing a basic web map app for showing various projects. I'm using v3.10 of the API and started with the "Popup content in side panel" sample. Instead of a static side panel for a selected feature's information, I decided to use a jQuery slide panel that appears when the user clicks on a feature (see the screenshot). I have added a close button within my slide panel which will close the panel and fire map.graphics.clear() to remove the graphic of the currently selected item. This all works just fine. What I want to do (can can't figure out the best way to do it) is close my side panel if the user clicks someplace on the map (but not on another feature). I tried to account for this using the following:
map.on("click", function() {
if(map.graphics.graphics.length == 0) {
//Close my side panel here
}
}
but the problem is that the click event fires before the selected graphic is removed and so map.graphics.graphics.length never equals zero. I've also thought about trying to tie into the map's graphicLayer and it's "graphics-clear" event but I can't seem to do it. The following returns null: theGraphicsLayer = map.graphics;
So what am I missing? The app isn't public facing yet so I can't link to a live example. Thanks! Steve Screenshot:
... View more
08-08-2014
10:22 AM
|
0
|
12
|
4589
|
|
POST
|
You can also try submitting the URL to your site to something like http://www.responsinator.com/ to see how it looks on various devices. It basically uses emulation to mimic what it would look like on the native device.
... View more
07-25-2014
04:18 PM
|
1
|
0
|
2252
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | 3 weeks ago | |
| 2 | 3 weeks ago | |
| 2 | 05-21-2026 01:51 PM | |
| 1 | 03-12-2026 01:43 PM | |
| 1 | 03-12-2026 08:41 AM |