Select to view content in your preferred language

Add PictureMarkerSymbol with InfoWindow without rest/querytask (with object array)

2498
3
08-20-2013 10:12 AM
JoachimPetersen
Emerging Contributor
Hello

How can you dynamically add PictureMarkerSymbol (with a flex shape as picture and coordinates) and then attach a InfoWindow to the PictureMarkerSymbol?
If so, is it also possible to give the PictureMarkerSymbol a ID, so you specifically delete that PictureMarkerSymbol?

How can I do this without rest/querytask but insted being called from an object array.

I really need help with this, I am sure many others are also experiencing problems with this, I have searched the forum and tried for days but with no succes.

Please help me with this as I need it for a project that I am working on, thank you.
Tags (2)
0 Kudos
3 Replies
BjornSvensson
Esri Regular Contributor
How can I do this without rest/querytask but insted being called from an object array.

I might be misunderstanding what you are trying to do, but as far as I understand your post:

You can populate a FeatureLayer using either the url (what you call rest/querytask) OR using a feature collection (which is what I think is what you are looking for). There is a sample for adding feature collections at:
https://developers.arcgis.com/en/flex/sample-code/time-rendered-gpx.htm
https://github.com/Esri/arcgis-samples-flex/blob/master/web/src/TemporalRenderer_FeatureCollection.m...

How can you dynamically add PictureMarkerSymbol (with a flex shape as picture and coordinates) and then attach a InfoWindow to the PictureMarkerSymbol?

Here are three examples for creating infowindows:
https://developers.arcgis.com/en/flex/sample-code/infowindows-for-featurelayer.htm
https://developers.arcgis.com/en/flex/sample-code/infowindow-on-click.htm
https://developers.arcgis.com/en/flex/sample-code/infowindow-on-mouseover.htm


If so, is it also possible to give the PictureMarkerSymbol a ID, so you specifically delete that PictureMarkerSymbol?


You wouldn't normally delete the symbol. but instead removing the feature. You can delete the feature in the featurecollection using featurelayer.remove().
0 Kudos
JoachimPetersen
Emerging Contributor
Thank you for your response, I can not figure out how you can populate a map with out a .gpx file containing the data, how can I just create a marker with a simple function with an x and y parameter input?
example: https://developers.arcgis.com/en/flex/sample-code/time-rendered-gpx.htm
I am new at this and I cannot seem to figure out how to do this
0 Kudos
JoachimPetersen
Emerging Contributor
Just to make absolutely clear what I want to do:
for each obj in my array collection
     ProcedureToPlotMap(obj.imageShape, obj.contentId, obj.title, obj.latcoord, obj.longcoord)
end for each

ProcedureToPlotMap should:
populate map with the imageShape(a rectangle with a image from an url that differes from each marker), at the giving coordinates (lat, long)
attaches an infowindow to the marker, that when you click on it, then it will display a title and inside the content: a button that has the passed contentId as a parameter (then just an event that catches the passed id and know what marker you pressed the button on)

The problem lies with I dont want to use any feed file, but simply from an array of objects. I know many have asked on this forum, none has posted a solution, so is this possible with this API? if so, please write a few code examples, this will not only help me, but alot others with same problem.
0 Kudos