ArcGIS Service Similar to Google Static Maps API

7839
7
04-18-2011 06:53 AM
TomNguyen1
New Contributor
Hello Experts:

Is there an ArcGIS service that is similar to Google Static Maps API described here:

"Google Static Maps API! The Google Static Maps API lets you embed a Google Maps image on your webpage without requiring JavaScript or any dynamic page loading. The Google Static Map service creates your map based on URL parameters sent through a standard HTTP request and returns the map as an image you can display on your web page."

Example:

Google Static Maps API Sample

Basically I want to be able to embed an ArcGIS map image via an URL with multiple lat/long points with custom marker for each point.

Thanks for your help.

Tom
7 Replies
TomWayson
Esri Contributor
I asked a similar question on stack overflow here:

http://stackoverflow.com/questions/5559219/whats-the-official-esri-solution-for-serving-up-static-ma...

What I had come up with on my own was to enable WMS functionality on the map service, and then I was able to access the map directly via a URL.  There are no URL parameters for adding markers, but you can specify which layers should be visible - which can include your "markers."

However, this seemed a bit kludgy to me, so I just put the question out there to see if there was an
official ESRI solution.  The response I got shows a way to export the map service as an image using JavaScript.  This gets around having to enable the WMS functionality on the map service, but you still have to run javascript to get export the map and dynamically add an image with the src set to the output.

I'd love to hear if anyone else has a "cleaner" solution.

Thanks,

Tom (W)
0 Kudos
wangzhifang
Occasional Contributor
I asked a similar question on stack overflow here:

http://stackoverflow.com/questions/5559219/whats-the-official-esri-solution-for-serving-up-static-ma...

What I had come up with on my own was to enable WMS functionality on the map service, and then I was able to access the map directly via a URL.  There are no URL parameters for adding markers, but you can specify which layers should be visible - which can include your "markers."

However, this seemed a bit kludgy to me, so I just put the question out there to see if there was an
official ESRI solution.  The response I got shows a way to export the map service as an image using JavaScript.  This gets around having to enable the WMS functionality on the map service, but you still have to run javascript to get export the map and dynamically add an image with the src set to the output.

I'd love to hear if anyone else has a "cleaner" solution.

Thanks,

Tom (W)


Hi, you can just using the soap api here:
http://services.arcgisonline.com/ArcGIS/sdk/soap/SOAP_Map_ExportMapImage.htm
and add custom graphics to mapdescription before exporting an map image.
0 Kudos
RaulJimenez1
New Contributor II

I have just plublished two projects exactly to do that:

Using a NodeJS script: esri-es/Static-Map-Service-ArcGIS · GitHub

Using a Javascript class: esri-es/Static-Maps-API-ArcGIS · GitHub

I hope it helps

Raúl

JasonKiesel
New Contributor II

@Raul- The difference between your solution and Google's is that their's is url based. A javascript solution is not ideal as you cannot embed the "image" into, say, an email. Unfortunately, a javascript solution is something we are unable to implement due to this limitation.

0 Kudos
RaulJimenez1
New Contributor II

Hi Jason Kiesel​,

You can do the URL base with this one: Static Map Service for ArcGIS

You just need to run that node script (node index.js) on a server and it will work as Google does:

<img src="http://staticmapservice.herokuapp.com/?center=Brooklyn+Bridge,New+York,NY&zoom=7&format=SVG&size=600...">

In that way you can embed or do whatever you need with that image.

Regards,

Raul

0 Kudos
DanielMarulanda
New Contributor

There is any update on this? The Node.JS server is a super complicated option, taking in count that it doesnt work with just one marker, and sometimes it returns error 400.

0 Kudos
GonzaloPlaza
New Contributor

Hi Raúl, do you know if its possible to draw polygons using this Static Map Service?. Google Maps does, but there is a limitation because URL length. You can't draw complex polygons with their API Get URL.

We're looking for a complete solution

Thank you in advance

0 Kudos