ARCGIS API 4 -- Custom marker images for each point or address - arcgis-js-api

There are several examples in the API, but for some reason, what I think the biggest feature is eluding me for some reason. I have a list of points and each point needs to be represented by a different icon. I also may have layers that use the same icon which I can find, just not the option for different icons/markers. An example of this would be greatly appreciated!!

I found out how to use the Graphic option to add an array of points that have a different url for their markers (symbols). This used the Picture Marker type. The beauty of JSON!!

Related

Add image or icon set to asset catalog to be used with NSToolbarItem

I have a set of pixel perfect icons which I want to use on toolbar (NSToolbar) of my app. Toolbar is configurable thus I need to provide icons in four sizes: small, standard, small#2x, standard#2x.
I could not find any official information about the size of those icons, but unofficial information (confirmed by my tests) is the following:
small is 24px, normal is 32px.
Thus I need to add four different images: 24x24px, 32x32px, 48x48px, 64x64px to my image set.
As for now I could not find a correct way for that.
I have tried a dozen of different methods but could not find one which preserves pixel perfect quality of all four images.
I believe, I can load right size of the image manually each time it has to be changed, but I am wondering if where is a correct way for that.
Does anyone has a good solution for that?
And yes, I clean build folder before each test.
See the Apple Developer site Human Interface guidelines for formats and sizes. The requirements are different for the different devices, and quite detailed.
For a quick & dirty solution if you're not ready to ship and just want nice looking graphics for testing, I've found that one 512 x 512 pdf, labeled "image#2x" works pretty well. You need to set the
imageScaling = .scaleProportionallyDown
and Cocoa will take care of the rest. But it's definitely not ready for prime-time.
The NSToolbar.sizeModes are enum: small and regular. Small is 24x24 and regular is 32x32; additionally the retina options allow for #2x (48x48 and 64x64) and potentially #3x future-forward.
Apple documentation on these sizes can be found here and here
Make sure to use enum Regular not "Standard", which is undocumented.

Read code markers of a images

I do not know the real name of this type of "QR" they are used in augmented reality and other tracking applications.
Here is a image of what it looks like.
I want to build a vb.net program that finds as many of this in a image. I do not need to get angels and so. Only a number.
The marker need to handler +10K of numbers and tolerate rotation.
I did use https://github.com/jcmellado/js-aruco as a template to solve my problem.

MapKit how to get the Bezier path of a State

When i look at apple's Map, I can see the different bezier path of a specific place. I would like to know how to extact that information directly from the map. So let's say the user selects New York, I would like to highlight NEW York's Bezier path directly on the map. can this be done?
You will need an alternative form of data that ideally is very close to or exactly the same as the border being drawn by MapKit. You aren't going to get this from Apple.
Take a look at this blog post, where I accomplish the same thing with an open source framework (Mapbox GL) on the web:
http://justinmiller.io/posts/2015/01/20/anatomy-of-a-travel-map/
The ability to highlight areas like this should work in the iOS version of the toolkit as well (https://github.com/mapbox/mapbox-gl-cocoa) though you will not be able to do the interactivity directly in that framework.

generate geo tiles from vector data

i am facing this problem : I have in my database some vector data (polylines ...) which describe many world/country/region/cities boundaries.
I would like to have an interactive map on thoses areas.
When i render those data in the browser (data are sent in geojson) this is slow (i'am not surprised).
The next reason, is to generate some raster tiles to represent the areas at different zoom level and to have a way to make the relation between a click on a area and the area selected (to display more info).
I am a newbie in geo tiles :
What is the best tool to generate png/jpg tiles from vector data?
How to make relation between an area clicked and a "id" in database?
I know my questions are very large, but if you have some advices ...
Thanks!
I recently wrote a blog posting on how to improve the rendering speed of raster tiles:
http://blog.webfoot.com/2013/03/12/optimizing-map-tile-generation/
As for connecting a click to a jurisdiction ID, I don't think there is a shortcut: you need to translate the click into lat/lng (or Vast Coordinate System, as I describe in the blog post) and then do a point-in-polygon check. If you are using PostGIS, then you can do an ST_Intersects.
NOTE: if you are using MySQL, the intersection is done with bounding boxes, not the polygons. It still is possible: you just need to grab a point-in-polygon function from somewhere to check which polygon if a bounding-box check gets you more than one.
Here is an example of dots you can click on:
http://maps.webfoot.com/demos/CanadianStimulus/CanadianStimulus.html
Note that because people aren't precise with clicking (especially with tiny dots), I actually make a few pixels around the dots "live" as well as the single-pixel dots. You can also click away from the dot, and then it will show the polygon (which in this example's case, is the federal electoral district).
There is a MongoDB Plugin datasource for Geoserver, a full featured WebGIS Server. You can use it to build up a map rendering service (a WMS actually) ofyour data. Then use Geowebcache to generate tiles of your map.
This way you can use fully featured WebGIS stack, which allows you to manage additional datasources, and easy tile subset recreation if portions of your data get updated.
Also querying features on a map (relation map position to element in database) is provided through Geoservers WFS implementation.

How do I make legends in Google Maps with a Google Fusion Tables Layer work?

i am using Google Fusion Tables and Google Maps to display geographical data (e.g. markers). My map needs to have a legend, for example by inserting a div on top of the map and the layer. As i am not used to work with API of any kind, i got stuck with this legend problem.
I tried several example codes (most of them provided by google), but none worked for me. I guess that the problem of displaying divs on a map has got something to do with either the styling of the map canvas, the div implementation within the body of the html document or with the framework used (google appengine). But this is just guessing. As i am not a professional with coding, i maybe missed a important point. Maybe the folks here can help me out?
Every hint is appreciated. Thanks.
You can have a look at the code and my example [here (deleted)]. There example includes a code which should display a div, but it doesn't. I've taken it from here (Stackoverflow).
The code you're using is v2 of the Maps API. You'll want to use code that works with v3 of the Maps API, since that is the version you're using on your site.
Have you tried the sample code here?
https://developers.google.com/fusiontables/docs/samples/legend
Copy and paste the legend code from this example into your initialize method, remove the old legend code. If this doesn't work, let me know.