Hyperlinks Outside Map Opens Popup, Is this possible?

691
5
05-16-2014 01:59 PM
ChristopherCarr
New Contributor III
I've searched high and low for an example of this and I can't find one anywhere.  Can anyone tell me if it is possible to have a web map embedded in a webpage and use hyperlinks that are outside of the web map to open up certain popup windows?  Any info or code samples that would get me going in the right direction would be greatly appreciated.
0 Kudos
5 Replies
ChristopherCarr
New Contributor III
Bumping this.  And wanted to say that the hyperlinks don't have to be outside of the map.  I'm more or less looking for some sort of a list view of attributes, on hover shows a pop up and on click goes to a URL.  Any advice would be much appreciated.
0 Kudos
TimWitt
Frequent Contributor
Something like this?

I used buttons though.

Also with your hover idea, check out this.

Hope this helps!

Tim
0 Kudos
ChristopherCarr
New Contributor III
Tim, thanks for your reply, this is exactly what I'm looking for!  I'd love to do this same thing, but without having to hard code everything.  I was thinking of trying to do this but with a feature layer.  This is a great start to something though, I'll play around with this and see what I can come up with.  If anyone else has any leads on integrating a feature layer with this funcitonality, please let me know.  Thanks!
0 Kudos
SteveCole
Frequent Contributor
I can think of a pretty kludgy way of doing this but I don't know if this will cause more problems for you than it solves. So here's the deal:

Your map would live on your web page as an Iframe. Within the page load JS for your Iframed map, you evaluate the URL for the IFrame to see if any parameters were passed along with the URL (e.g. "http://www.mymap.org/index.html?bridgeNumber=200"). If the code senses a parameter, you then perform your code to zoom to your feature & display the infoWindow. If there's no parameter passed, just load the map normally. Whenever you want to zoom to a different feature, just change the URL for the IFrame and reload it.

I've done this successfully in Microsoft Access where I wanted a map on my form to zoom to a location as the user changes records in the database.

Steve
0 Kudos
AlexandraAreskog
New Contributor
http://jsbin.com/kuneq/3/edit?js,output

I figured out a solution here, the code is a little messy b/c it was a work in progress

you could probably use mouseover instead of click to get a hover--- and also have an additional click event that takes you to the URL
0 Kudos