Code Monkey home page Code Monkey logo

google-vector-layers's Introduction

This library will add Google Maps vector (Point, Polyline, Polygon) layers from multiple geo web services including ArcGIS Server, GeoIQ, Arc2Earth, etc.

ArcGIS Server (vectors.AGS)

ArcGIS Server layers have one mandatory option, a url.

I suggest also adding a uniqueField option. You can most likely use your OBJECTID field if you've left this visible in your map service. This helps determine if the features returned by the API request are already on the map. If no uniqueField option is given, all features are removed after each map pan/zoom. :-( I'm sure there's a better way, but that's what I've got for now.

var myAgsLayer = new vectors.AGS({
    url: "http://my-arcgis-server.com/arcgis/rest/services/MyMapService/MapServer/11" 
});
myAgsLayer.setMap(myMap);

Some other optional parameters for ArcGIS Server layers:

  • fields (string) - comma separated fields you want returned, returns all fields by default
  • where (string) - additional SQL where clause to filter features, return all features by default - ex. "road_type = 'paved'"
  • scaleRange (array) - min and max Google Maps scales to draw this feature - ex. [13, 21]
  • vectorOptions (object) - Google Maps vector options specific to feature type - ex. {strokeWeight: 3, strokeColor: "#ff0099"}
  • map (google.maps.Map object) - if you pass this in initially, there's no need to call setMap(my_map)

Arc2Earth (vectors.A2E)

Arc2Earth layers have one mandatory option, a url.

myA2eLayer = new vectors.A2E({
	url: "http://jeesanford.appspot.com/a2e/data/datasources/wtr_main"
});

Some other optional parameters for Arc2Earth layers:

  • where (string) - additional SQL where clause to filter features, return all features by default - ex. "PROJECT_NAME='Stoney Creek'"
  • scaleRange (array) - min and max Google Maps scales to draw this feature - ex. [13, 21]
  • vectorOptions (object) - Google Maps vector options specific to feature type - ex. {strokeWeight: 3, strokeColor: "#ff0099"}
  • map (google.maps.Map object) - if you pass this in initially, there's no need to call setMap(my_map)https://github.com/JasonSanford/google-vector-layers/blob/master/README

Geocommons (vectors.Geocommons)

Geocommons layers have one mandatory option, a dataset. All datasets in Geocommons have a unique dataset id.

There is currently an issue requesting GeoJSON features from Geocommons where other URL parameters aren't honored. For now, all features are pull with each map pan/zoom. (not ideal!) For details see http://getsatisfaction.com/geocommons/topics/features_api_doesnt_honor_url_parameters_when_requesting_geojson

myGeocommonsLayer = new vectors.Geocommons({
    dataset: 111601
});

Some other optional parameters for Geocommons layers:

  • scaleRange (array) - min and max Google Maps scales to draw this feature - ex. [13, 21]
  • vectorOptions (object) - Google Maps vector options specific to feature type - ex. {strokeWeight: 3, strokeColor: "#ff0099"}
  • map (google.maps.Map object) - if you pass this in initially, there's no need to call setMap(my_map)

google-vector-layers's People

Contributors

jasonsanford avatar

Stargazers

 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.