2013-01-17 3 views
0

mapstraction v2를 사용하고 있습니다. Google을 제공 업체로 선택할 때 Google지도 v3을 양식화해야합니다. google.maps.MapOptions 객체의 스타일 속성에 전달할 JSON 객체를 생성하는 Google의 '스타일지도 마법사'도구를 사용했습니다. 이 도구는 다음과 같은 모양의 JSON을 생성합니다. { "featureType": "landscape.man_made", "elementType": "geometry.fill", "stylers": {{ "visibility": "on"}, { "color"Mapstraction 및 JSON Google지도 스타일

mapstraction = new mxn.Mapstraction('mymap', 'googlev3', true); 
    json = { "featureType": "landscape.man_made", "elementType": "geometry.fill", "stylers": [ { "visibility": "on" },{ "color": "#404040" } ] } 
    mapstraction.addJSON(json); 

을하더라도 :이 JSON 객체 포맷을 다시 어떻게 mapstraction는 다음과 같이로드 할 수 있도록/경우 "#은 404040"}]}, 등 ...

그러나, 나는 알아낼 수 없습니다 더 좋은 점은 mxn.util.loadScript를 사용하여 URL에서 json 데이터를 직접 가져올 수 있는지 알고 싶습니다.

저는 웹 매핑에 완전히 익숙하지 않아 지금은 불가능한 mapstraction으로 무언가를하려고 할 수도 있습니다. 그렇게 생각? 아카이브를 검색해 보니 json이 다르게 보였지만 mapstraction으로 사용할 수 있도록 포맷을 다시 지정하는 방법을 설명하는 답변을 찾을 수 없습니다. 이 작업을 수행하는 방법을 알고 있습니까?

답변

0

이 예는 도움이됩니까?

추출 http://mapstraction.appspot.com/#json

json = { 
    features: [{ 
     "type": "Feature", 
     "toponym": null, 
     "title": "DSC_0023.JPG", 
     "author": "ugef", 
     "id": 1930723, 
     "description": "", 
     "categories": "california unitedstates sanjose eyefi", 
     "geometry": { 
      "type": "Point", 
      "coordinates": [-121.896263,37.328655] 
     }, 
     "properties": 
     { 
      "icon_shadow": "http://mapstraction.appspot.com/images/blank.png", 
      "icon_shadow_size": [0,0], 
      "line_color": "", 
      "icon": "http://mapstraction.appspot.com/images/flickr_marker.png", 
      "line_opacity": 1.0, 
      "pubdate": "2008/07/03 20:14:01 +0000", 
      "line_width": 1.0, 
      "poly_color": "", 
      "icon_size": [16,16] 
     }, 
     "source_id": 1000014 
    } 
    ] 
} 
// 
mapstraction.addJSON(json); 
에서